elm_code: Fix position of cursor in selection

Make sure cursor is always at the left of our selection
@fix
This commit is contained in:
Andy Williams 2017-03-07 15:46:41 +00:00
parent d4dd0b20df
commit 53c9a06c2d
1 changed files with 8 additions and 0 deletions

View File

@ -472,9 +472,17 @@ static void
_elm_code_widget_selection_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
Elm_Code_Widget *widget;
Elm_Code_Widget_Selection_Data *selection;
widget = (Elm_Code_Widget *)data;
if (!elm_code_widget_selection_is_empty(widget))
{
selection = elm_code_widget_selection_normalized_get(widget);
elm_code_widget_cursor_position_set(widget, selection->start_line, selection->start_col);
free(selection);
}
_elm_code_widget_refresh(widget, NULL);
}