ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/tools/edi.git/commit/?id=1cc89c78a25ad83007f4c00b7ecbff3866c0be52

commit 1cc89c78a25ad83007f4c00b7ecbff3866c0be52
Author: Andy Williams <a...@andywilliams.me>
Date:   Sun Jun 7 23:13:26 2015 +0100

    elm_code: remove selections if moving cursor
    
    The selection remaining after cursor move was getting confusing
---
 elm_code/src/lib/widget/elm_code_widget.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/elm_code/src/lib/widget/elm_code_widget.c 
b/elm_code/src/lib/widget/elm_code_widget.c
index bf34af4..a2888d2 100644
--- a/elm_code/src/lib/widget/elm_code_widget.c
+++ b/elm_code/src/lib/widget/elm_code_widget.c
@@ -758,6 +758,7 @@ _elm_code_widget_cursor_move_home(Elm_Code_Widget *widget)
    Elm_Code_Widget_Data *pd;
 
    pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
+   elm_code_widget_selection_clear(widget);
 
    if (pd->cursor_col <= 1)
      return;
@@ -773,6 +774,7 @@ _elm_code_widget_cursor_move_end(Elm_Code_Widget *widget)
    unsigned int lastcol;
 
    pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
+   elm_code_widget_selection_clear(widget);
 
    line = elm_code_file_line_get(pd->code->file, pd->cursor_line);
    lastcol = elm_code_widget_line_text_column_width_get(widget, line);
@@ -792,6 +794,7 @@ _elm_code_widget_cursor_move_up(Elm_Code_Widget *widget)
    pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
    row = pd->cursor_line;
    col = pd->cursor_col;
+   elm_code_widget_selection_clear(widget);
 
    if (pd->cursor_line <= 1)
      return;
@@ -815,6 +818,7 @@ _elm_code_widget_cursor_move_down(Elm_Code_Widget *widget)
    pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
    row = pd->cursor_line;
    col = pd->cursor_col;
+   elm_code_widget_selection_clear(widget);
 
    if (pd->cursor_line >= elm_code_file_lines_get(pd->code->file))
      return;
@@ -834,6 +838,7 @@ _elm_code_widget_cursor_move_left(Elm_Code_Widget *widget)
    Elm_Code_Widget_Data *pd;
 
    pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
+   elm_code_widget_selection_clear(widget);
 
    if (pd->cursor_col <= 1)
      {
@@ -855,6 +860,7 @@ _elm_code_widget_cursor_move_right(Elm_Code_Widget *widget)
    Elm_Code_Line *line;
 
    pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
+   elm_code_widget_selection_clear(widget);
 
    line = elm_code_file_line_get(pd->code->file, pd->cursor_line);
    if (pd->cursor_col > elm_code_widget_line_text_column_width_get(widget, 
line))
@@ -890,6 +896,7 @@ _elm_code_widget_cursor_move_pageup(Elm_Code_Widget *widget)
    row = pd->cursor_line;
    col = pd->cursor_col;
 
+   elm_code_widget_selection_clear(widget);
    if (pd->cursor_line <= 1)
      return;
 
@@ -917,6 +924,7 @@ _elm_code_widget_cursor_move_pagedown(Elm_Code_Widget 
*widget)
    row = pd->cursor_line;
    col = pd->cursor_col;
 
+   elm_code_widget_selection_clear(widget);
    if (pd->cursor_line >= elm_code_file_lines_get(pd->code->file))
      return;
 

-- 


Reply via email to