nikawhite pushed a commit to branch master.

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

commit ba45d8689e9371e6a6451c5d52ebcedb2dd46317
Author: Mykyta Biliavskyi <m.biliavs...@samsung.com>
Date:   Wed Sep 16 09:50:08 2015 +0000

    Edc Editor: after dismissing candidate list, cursor is moved at the end of 
attribute.
    
    After choose or hide the candidate, the entry cursor
    is moved to the end of attribute string ';'. It is more natural
    way, than was previously, when cursor was placed before ':'.
---
 src/lib/edc_editor.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/lib/edc_editor.c b/src/lib/edc_editor.c
index cbc5ac3..3d9c64f 100644
--- a/src/lib/edc_editor.c
+++ b/src/lib/edc_editor.c
@@ -328,6 +328,24 @@ ctxpopup_candidate_dismiss_cb(void *data, Evas_Object *obj,
                               void *event_info EINA_UNUSED)
 {
    edit_data *ed = data;
+
+   int cur_pos = elm_entry_cursor_pos_get(ed->en_edit);
+   elm_entry_cursor_line_end_set(ed->en_edit);
+   int end_pos = elm_entry_cursor_pos_get(ed->en_edit);
+   int i = 0;
+   char *ch;
+
+   for (i = cur_pos; i <= end_pos; i++)
+     {
+        elm_entry_cursor_pos_set(ed->en_edit, i);
+        ch = elm_entry_cursor_content_get(ed->en_edit);
+        if (*ch == ';')
+          {
+             elm_entry_cursor_pos_set(ed->en_edit, i + 1);
+             break;
+          }
+     }
+
    evas_object_del(obj);
    elm_object_tree_focus_allow_set(ed->layout, EINA_TRUE);
    elm_object_focus_set(ed->en_edit, EINA_TRUE);

-- 


Reply via email to