summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-03-07 15:46:41 +0000
committerAndy Williams <andy@andywilliams.me>2017-03-10 14:27:17 +0000
commit53c9a06c2dd2761bfc416a5986252c2fb4c06136 (patch)
tree6352a114a6a304017440524f042749d52cb72dd2
parentd4dd0b20dfa00d9b6fda9490d5c48dcbbad5de8f (diff)
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.c8
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
472_elm_code_widget_selection_cb(void *data, const Efl_Event *event EINA_UNUSED) 472_elm_code_widget_selection_cb(void *data, const Efl_Event *event EINA_UNUSED)
473{ 473{
474 Elm_Code_Widget *widget; 474 Elm_Code_Widget *widget;
475 Elm_Code_Widget_Selection_Data *selection;
475 476
476 widget = (Elm_Code_Widget *)data; 477 widget = (Elm_Code_Widget *)data;
477 478
479 if (!elm_code_widget_selection_is_empty(widget))
480 {
481 selection = elm_code_widget_selection_normalized_get(widget);
482 elm_code_widget_cursor_position_set(widget, selection->start_line, selection->start_col);
483 free(selection);
484 }
485
478 _elm_code_widget_refresh(widget, NULL); 486 _elm_code_widget_refresh(widget, NULL);
479} 487}
480 488