| 77 |
long line_offsets[MAX_EDITOR_DATA_LINES + 1]; |
long line_offsets[MAX_EDITOR_DATA_LINES + 1]; |
| 78 |
long current_data_line_length = 0; |
long current_data_line_length = 0; |
| 79 |
long i; |
long i; |
| 80 |
|
int j; |
| 81 |
|
|
| 82 |
if (p_data == NULL) |
if (p_data == NULL) |
| 83 |
{ |
{ |
| 124 |
memcpy(p_editor_data->p_display_lines[i], p_data + line_offsets[i], (size_t)p_editor_data->display_line_lengths[i]); |
memcpy(p_editor_data->p_display_lines[i], p_data + line_offsets[i], (size_t)p_editor_data->display_line_lengths[i]); |
| 125 |
current_data_line_length += p_editor_data->display_line_lengths[i]; |
current_data_line_length += p_editor_data->display_line_lengths[i]; |
| 126 |
|
|
| 127 |
|
// Convert \t to single space |
| 128 |
|
for (j = 0; j < p_editor_data->display_line_lengths[i]; j++) |
| 129 |
|
{ |
| 130 |
|
if (p_editor_data->p_display_lines[i][j] == '\t') |
| 131 |
|
{ |
| 132 |
|
p_editor_data->p_display_lines[i][j] = ' '; |
| 133 |
|
} |
| 134 |
|
} |
| 135 |
|
|
| 136 |
// Trim \n from last line |
// Trim \n from last line |
| 137 |
if (i + 1 == p_editor_data->display_line_total && |
if (i + 1 == p_editor_data->display_line_total && |
| 138 |
p_editor_data->display_line_lengths[i] > 0 && |
p_editor_data->display_line_lengths[i] > 0 && |
| 679 |
int i, j; |
int i, j; |
| 680 |
char *p_str; |
char *p_str; |
| 681 |
int del_line; |
int del_line; |
| 682 |
|
int tab_width = 0; |
| 683 |
|
|
| 684 |
clrline(output_current_row, SCREEN_ROWS); |
clrline(output_current_row, SCREEN_ROWS); |
| 685 |
|
|
| 718 |
moveto((int)row_pos, (int)col_pos); |
moveto((int)row_pos, (int)col_pos); |
| 719 |
iflush(); |
iflush(); |
| 720 |
|
|
| 721 |
|
tab_width = 0; |
| 722 |
str_len = 0; |
str_len = 0; |
| 723 |
ch = igetch_t(BBS_max_user_idle_time); |
ch = igetch_t(BBS_max_user_idle_time); |
| 724 |
while (!SYS_server_exit) |
while (!SYS_server_exit) |
| 734 |
goto cleanup; |
goto cleanup; |
| 735 |
} |
} |
| 736 |
|
|
| 737 |
|
if (ch == '\t') |
| 738 |
|
{ |
| 739 |
|
ch = ' '; |
| 740 |
|
tab_width = TAB_SIZE - ((int)(col_pos - 1) % TAB_SIZE) - 1; |
| 741 |
|
} |
| 742 |
|
|
| 743 |
if (ch < 256 && (ch & 0x80)) // head of multi-byte character |
if (ch < 256 && (ch & 0x80)) // head of multi-byte character |
| 744 |
{ |
{ |
| 745 |
str_len = 0; |
str_len = 0; |
| 858 |
break; |
break; |
| 859 |
} |
} |
| 860 |
|
|
| 861 |
ch = igetch(0); |
if (ch == ' ' && tab_width > 0) |
|
if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Output if no futher input |
|
| 862 |
{ |
{ |
| 863 |
break; |
tab_width--; |
| 864 |
|
} |
| 865 |
|
else |
| 866 |
|
{ |
| 867 |
|
ch = igetch(0); |
| 868 |
|
if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Output if no futher input |
| 869 |
|
{ |
| 870 |
|
break; |
| 871 |
|
} |
| 872 |
} |
} |
| 873 |
|
|
| 874 |
str_len = 0; |
str_len = 0; |