mainview: check end bounds also.

This commit is contained in:
Alastair Poole 2020-03-06 01:40:52 +00:00
parent 29ed0013a1
commit fdf22ab85c
1 changed files with 5 additions and 0 deletions

View File

@ -801,6 +801,7 @@ void
edi_mainview_panel_goto_position(Edi_Mainview_Panel *panel, unsigned int row, unsigned int col)
{
Edi_Editor *editor;
Elm_Code *code;
if (!panel || !panel->current)
return;
@ -809,6 +810,10 @@ edi_mainview_panel_goto_position(Edi_Mainview_Panel *panel, unsigned int row, un
if (!editor || row <= 0 || col <= 0)
return;
code = elm_code_widget_code_get(editor->entry);
if (row > elm_code_file_lines_get(code->file))
return;
elm_code_widget_cursor_position_set(editor->entry, row, col);
elm_object_focus_set(editor->entry, EINA_TRUE);
}