woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=84685df233b2e499227a6c4e990c6216117a9a21

commit 84685df233b2e499227a6c4e990c6216117a9a21
Author: Ali Alzyod <[email protected]>
Date:   Thu Dec 26 09:55:28 2019 +0900

    efl_text_cursor: line jump by fix movement
    
    Summary:
    When the cursor is at line beginning of line, and user click "Up" then 
"Down" on keyboard cursor will position at second character.
    If text is:  **occaecat \n mollit**
    
    Reviewers: woohyun, zmike, cedric, segfaultxavi
    
    Reviewed By: woohyun
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Maniphest Tasks: T8454
    
    Differential Revision: https://phab.enlightenment.org/D10947
---
 src/lib/evas/canvas/evas_object_textblock.c | 2 +-
 src/tests/evas/evas_test_textblock.c        | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index c47175fcc2..5516e712bd 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -11033,7 +11033,7 @@ 
evas_textblock_cursor_line_jump_by(Efl_Text_Cursor_Handle *cur, int by)
    pnode = cur->node;
    ppos = cur->pos;
 
-   evas_textblock_cursor_geometry_get(cur, &cx, NULL, &cw, NULL, NULL, 
EVAS_TEXTBLOCK_CURSOR_UNDER);
+   evas_textblock_cursor_geometry_get(cur, &cx, NULL, &cw, NULL, NULL, 
EVAS_TEXTBLOCK_CURSOR_BEFORE);
    cx += (cw / 2);
    evas_textblock_cursor_paragraph_last(cur);
    last = evas_textblock_cursor_line_geometry_get(cur, NULL, NULL, NULL, NULL);
diff --git a/src/tests/evas/evas_test_textblock.c 
b/src/tests/evas/evas_test_textblock.c
index f4806cb459..3a112a0048 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4522,6 +4522,13 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
       efl_text_cursor_text_object_get(cursor1),
       efl_text_cursor_text_object_get(cursor_temp));
 
+   efl_text_set(txt, "occaecat \n mollit");
+   efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
+   efl_text_cursor_line_jump_by(cur_obj, 1);
+   efl_text_cursor_line_jump_by(cur_obj, -1);
+   ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
+
+
    END_EFL_CANVAS_TEXTBLOCK_TEST();
 }
 EFL_END_TEST

-- 


Reply via email to