hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=41106fe20fe991e42633fbc9a9b7155db971cc90

commit 41106fe20fe991e42633fbc9a9b7155db971cc90
Author: Mykyta Biliavskyi <m.biliavs...@samsung.com>
Date:   Thu Aug 20 11:31:27 2015 +0900

    Edje_Entry: check selection before the cursor position change.
    
    Summary:
    change position of the main textblock cursor
    in depends of the selection is present. Change cursor position to
    the start or end of selection only when selection is present.
    @fix
    
    Test Plan:
    Press "Up" and "Down" arrow keys on selected and normal text.
    For selected text: the entry cursor should be placed one line
       above or below selection block (in depends from pressed button).
    For normal text: the entry cursor should be placed one line
       above or below of the current cursor position.
    
    Reviewers: tasn, Hermet, herdsman
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D2948
---
 src/lib/edje/edje_entry.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 8b4f256..b7289b4 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -1461,7 +1461,7 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, 
Evas_Object *obj EINA_UNUSED,
                        _sel_start(en->cursor, rp->object, en);
                        ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
                     }
-                  else
+                  else if (en->have_selection)
                     {
                        if (evas_textblock_cursor_compare(en->sel_start, 
en->sel_end) < 0)
                          evas_textblock_cursor_copy(en->sel_start, en->cursor);
@@ -1497,7 +1497,7 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, 
Evas_Object *obj EINA_UNUSED,
                        _sel_start(en->cursor, rp->object, en);
                        ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
                     }
-                  else
+                  else if (en->have_selection)
                     {
                        if (evas_textblock_cursor_compare(en->sel_start, 
en->sel_end) < 0)
                          evas_textblock_cursor_copy(en->sel_end, en->cursor);

-- 


Reply via email to