diff options
author | Andy Williams <andy@andywilliams.me> | 2017-03-07 15:46:41 +0000 |
---|---|---|
committer | Andy Williams <andy@andywilliams.me> | 2017-03-10 14:27:17 +0000 |
commit | 53c9a06c2dd2761bfc416a5986252c2fb4c06136 (patch) | |
tree | 6352a114a6a304017440524f042749d52cb72dd2 | |
parent | d4dd0b20dfa00d9b6fda9490d5c48dcbbad5de8f (diff) | |
download | efl-53c9a06c2dd2761bfc416a5986252c2fb4c06136.tar.gz |
elm_code: Fix position of cursor in selection
Make sure cursor is always at the left of our selection
@fix
-rw-r--r-- | src/lib/elementary/elm_code_widget.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c index 4d0ea3a2ab..994518a397 100644 --- a/src/lib/elementary/elm_code_widget.c +++ b/src/lib/elementary/elm_code_widget.c @@ -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); } |