hermet pushed a commit to branch master.


commit cf417f8fa485bc948ef7b852805124b52f590894
Author: taehyub <taehyub....@samsung.com>
Date:   Wed Feb 17 20:37:22 2016 +0900

    fix the unexpected selection problem
    There is a delay for getting selection start position.
    It cause the wrong selection recovery.
    so I modified the selection recover logic
    using the selection region of entry.
    Reviewers: Hermet, Jaehyun_Cho, NikaWhite
    Differential Revision: https://phab.enlightenment.org/D3680
 src/lib/edc_editor.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lib/edc_editor.c b/src/lib/edc_editor.c
index 9c4e062..9a7c522 100644
--- a/src/lib/edc_editor.c
+++ b/src/lib/edc_editor.c
@@ -162,9 +162,12 @@ entry_recover(edit_data *ed, int cursor_pos, int 
sel_cur_begin, int sel_cur_end)
    //recover selection region
    const char *selected = elm_entry_selection_get(ed->en_edit);
    if (!selected) return;
+   char *select_utf8 = elm_entry_markup_to_utf8(selected);
    ed->on_select_recover = EINA_TRUE;
+   //there is a delay for getting ed->select_pos
+   //so here, calculate selection position using selection region
-                               ed->select_pos,
+                               cursor_pos - strlen(select_utf8),
    ed->on_select_recover = EINA_FALSE;


Reply via email to