| 169 |
// Get accurate offset of first character of CJK at offset position |
// Get accurate offset of first character of CJK at offset position |
| 170 |
for (i = 0; i < offset; i++) |
for (i = 0; i < offset; i++) |
| 171 |
{ |
{ |
| 172 |
if (p_editor_data->p_display_lines[display_line][i] < 0) // GBK |
if (p_editor_data->p_display_lines[display_line][i] < 0 || p_editor_data->p_display_lines[display_line][i] > 127) // GBK |
| 173 |
{ |
{ |
| 174 |
i++; |
i++; |
| 175 |
} |
} |
| 368 |
// Get accurate offset of first character of CJK at offset position |
// Get accurate offset of first character of CJK at offset position |
| 369 |
for (i = 0; i < offset; i++) |
for (i = 0; i < offset; i++) |
| 370 |
{ |
{ |
| 371 |
if (p_editor_data->p_display_lines[display_line][i] < 0) // GBK |
if (p_editor_data->p_display_lines[display_line][i] < 0 || p_editor_data->p_display_lines[display_line][i] > 127) // GBK |
| 372 |
{ |
{ |
| 373 |
i++; |
i++; |
| 374 |
} |
} |
| 417 |
} |
} |
| 418 |
else |
else |
| 419 |
{ |
{ |
| 420 |
log_error("Some strange character at display_line %ld, offset %ld\n", display_line, offset); |
log_error("Some strange character at display_line %ld, offset %ld: %d %d %d %d\n", |
| 421 |
return -2; |
display_line, offset, p_data_line[offset_data_line], p_data_line[offset_data_line + 1], |
| 422 |
|
p_data_line[offset_data_line + 2], p_data_line[offset_data_line + 3]); |
| 423 |
|
str_len = 1; |
| 424 |
} |
} |
| 425 |
|
|
| 426 |
// Current display line is (almost) empty |
// Current display line is (almost) empty |