forked from enlightenment/edi
Fix SEGV on goto line when out of range
Reviewers: ajwillia.ms Reviewed By: ajwillia.ms Differential Revision: https://phab.enlightenment.org/D4745
This commit is contained in:
parent
629a293a66
commit
d0997ca6a8
|
@ -632,15 +632,23 @@ edi_mainview_search()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
edi_mainview_goto(int line)
|
edi_mainview_goto(int number)
|
||||||
{
|
{
|
||||||
Edi_Editor *editor;
|
Edi_Editor *editor;
|
||||||
|
Elm_Code *code;
|
||||||
|
Elm_Code_Line *line;
|
||||||
|
|
||||||
editor = (Edi_Editor *)evas_object_data_get(_current_view, "editor");
|
editor = (Edi_Editor *)evas_object_data_get(_current_view, "editor");
|
||||||
if (!editor || line <= 0)
|
if (!editor || number <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
elm_code_widget_cursor_position_set(editor->entry, line, 1);
|
code = elm_code_widget_code_get(editor->entry);
|
||||||
|
|
||||||
|
line = elm_code_file_line_get(code->file, number);
|
||||||
|
if (!line)
|
||||||
|
return;
|
||||||
|
|
||||||
|
elm_code_widget_cursor_position_set(editor->entry, number, 1);
|
||||||
elm_object_focus_set(editor->entry, EINA_TRUE);
|
elm_object_focus_set(editor->entry, EINA_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue