diff options
author | Alastair Poole <netstar@gmail.com> | 2020-03-06 01:23:35 +0000 |
---|---|---|
committer | Alastair Poole <netstar@gmail.com> | 2020-03-06 01:23:35 +0000 |
commit | bd6608dd90736758bb8befc623af87eb97689a6c (patch) | |
tree | 7382a47a8c08d2ed6470930ff1b172dcb67b9f5e | |
parent | 7a89b7711f5dcd1c7f177634730b64cfbc9d1c06 (diff) | |
download | efl-bd6608dd90736758bb8befc623af87eb97689a6c.tar.gz |
elm_code: Avoid moving to non-existent line.
Check for line existence before moving cursor.
-rw-r--r-- | src/lib/elementary/elm_code_widget.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c index 292a902d77..1ab0061c2a 100644 --- a/src/lib/elementary/elm_code_widget.c +++ b/src/lib/elementary/elm_code_widget.c @@ -711,7 +711,10 @@ _elm_code_widget_cursor_move(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd, pd->cursor_col = col; pd->cursor_line = line; - if (line > eina_list_count(pd->grids) && !pd->selection && !pd->selection->in_progress) + if (line > elm_code_file_lines_get(pd->code->file)) + return; + + if ((line > eina_list_count(pd->grids)) && (!pd->selection)) { if (_elm_code_widget_viewport_get(widget, pd, &first_row, &last_row)) { |