hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=7f6206269efc940505251c16e368cd27cdf6dbbf

commit 7f6206269efc940505251c16e368cd27cdf6dbbf
Author: Jaehyun Cho <[email protected]>
Date:   Tue Oct 28 01:23:24 2014 +0900

    search: Fix to clear selection when find window is moved or closed.
    
    Summary: Fix to clear selection when find window is moved or closed. 
Otherwise, the selection block begins from old one.
    
    Reviewers: Hermet
    
    Differential Revision: https://phab.enlightenment.org/D1581
---
 src/bin/search.c           |  1 +
 src/lib/edc_editor.c       | 12 +++++++++---
 src/lib/enventor_private.h |  1 +
 src/lib/enventor_smart.c   |  1 +
 4 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/bin/search.c b/src/bin/search.c
index ebaa114..5a5ddfd 100644
--- a/src/bin/search.c
+++ b/src/bin/search.c
@@ -430,6 +430,7 @@ search_close(void)
    search_data *sd = g_sd;
    if (!sd) return;
 
+   enventor_object_select_none(sd->enventor);
    while (sd->syntax_color > 0)
      {
         enventor_object_syntax_color_partial_apply(sd->enventor, -1);
diff --git a/src/lib/edc_editor.c b/src/lib/edc_editor.c
index da68626..918a9e4 100644
--- a/src/lib/edc_editor.c
+++ b/src/lib/edc_editor.c
@@ -530,14 +530,20 @@ cur_line_pos_set(edit_data *ed, Eina_Bool force)
                                    (void *)line);
 }
 
+void
+edit_selection_clear(edit_data *ed)
+{
+   if (ed->on_select_recover) return;
+   cur_line_pos_set(ed, EINA_TRUE);
+   ed->select_pos = -1;
+}
+
 static void
 edit_selection_cleared_cb(void *data, Evas_Object *obj EINA_UNUSED,
                           void *event_info EINA_UNUSED)
 {
    edit_data *ed = data;
-   if (ed->on_select_recover) return;
-   cur_line_pos_set(ed, EINA_TRUE);
-   ed->select_pos = -1;
+   edit_selection_clear(ed);
 }
 
 static void
diff --git a/src/lib/enventor_private.h b/src/lib/enventor_private.h
index f0248ba..51a013e 100644
--- a/src/lib/enventor_private.h
+++ b/src/lib/enventor_private.h
@@ -223,5 +223,6 @@ Eina_Bool edit_part_highlight_get(edit_data *ed);
 void edit_ctxpopup_set(edit_data *ed, Eina_Bool ctxpopup);
 Eina_Bool edit_ctxpopup_get(edit_data *ed);
 Eina_Bool edit_load(edit_data *ed, const char *edc_path);
+void edit_selection_clear(edit_data *ed);
 
 #endif
diff --git a/src/lib/enventor_smart.c b/src/lib/enventor_smart.c
index e0a49d2..a22f893 100644
--- a/src/lib/enventor_smart.c
+++ b/src/lib/enventor_smart.c
@@ -416,6 +416,7 @@ EOLIAN static void
 _enventor_object_select_region_set(Eo *obj EINA_UNUSED,
                                    Enventor_Object_Data *pd, int start, int 
end)
 {
+   edit_selection_clear(pd->ed);
    elm_entry_select_region_set(edit_entry_get(pd->ed), start, end);
 }
 

-- 


Reply via email to