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
This commit is contained in:
Jaehyun Cho 2014-10-28 01:23:24 +09:00 committed by ChunEon Park
parent ed3a2b93e5
commit 7f6206269e
4 changed files with 12 additions and 3 deletions

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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);
}