texteditor: fix being able to select invalid line

This commit is contained in:
Marco Kirchner 2016-09-09 15:47:20 +02:00
parent 18d8e4ae68
commit 3b17b60578

3
text.c
View File

@ -370,7 +370,8 @@ int textViewer(char *file) {
} else if (hold_buttons & SCE_CTRL_DOWN || hold2_buttons & SCE_CTRL_LEFT_ANALOG_DOWN) {
if (offset_list[rel_pos + 1] < size) {
if ((rel_pos + 1) < MAX_POSITION) {
rel_pos++;
if (base_pos + rel_pos < n_lines - 1)
rel_pos++;
} else {
if (offset_list[base_pos + rel_pos + 1] < size) {
base_pos++;