elm_code: Avoid moving to non-existent line.

Check for line existence before moving cursor.
This commit is contained in:
Alastair Poole 2020-03-06 01:23:35 +00:00
parent 7a89b7711f
commit bd6608dd90
1 changed files with 4 additions and 1 deletions

View File

@ -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))
{