forked from enlightenment/efl
Efl.Text.Cursor: Fix line_jump_by return logic
Summary: From documentation `line_jump_by` should return `EINA_TRUE` if cursor moved, and `EINA_FALSE` if not moved. But the current behaviour is reversed, so this should fix it. Reviewers: ali.alzyod, segfaultxavi, woohyun Subscribers: AbdullehGhujeh, #committers, cedric, #reviewers Tags: #efl Maniphest Tasks: T8454 Differential Revision: https://phab.enlightenment.org/D10946
This commit is contained in:
parent
a6a44ecb9d
commit
ce28963654
|
@ -203,7 +203,7 @@ _efl_text_cursor_line_jump_by(Eo *obj EINA_UNUSED, Efl_Text_Cursor_Data *pd, int
|
|||
Eina_Bool moved = EINA_FALSE;
|
||||
int pos = evas_textblock_cursor_pos_get(pd->handle);
|
||||
evas_textblock_cursor_line_jump_by(pd->handle, by);
|
||||
moved = (pos == evas_textblock_cursor_pos_get(pd->handle));
|
||||
moved = (pos != evas_textblock_cursor_pos_get(pd->handle));
|
||||
return moved;
|
||||
}
|
||||
|
||||
|
|
|
@ -4488,12 +4488,12 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
|
|||
efl_event_callback_add(txt, EFL_CANVAS_TEXTBLOCK_EVENT_CHANGED, _increment_int_changed, &changed_emit);
|
||||
const char *buf = "abcdefghij";
|
||||
efl_text_set(txt, buf);
|
||||
fail_if(strcmp(efl_text_get(txt), buf));
|
||||
ck_assert_int_eq(strcmp(efl_text_get(txt), buf), 0);
|
||||
|
||||
efl_text_cursor_line_jump_by(cur_obj, -1);
|
||||
ck_assert(!efl_text_cursor_line_jump_by(cur_obj, -1));
|
||||
pos = efl_text_cursor_position_get(cur_obj);
|
||||
ck_assert_int_eq(pos, 0);
|
||||
efl_text_cursor_line_jump_by(cur_obj, 1);
|
||||
ck_assert(efl_text_cursor_line_jump_by(cur_obj, 1));
|
||||
pos = efl_text_cursor_position_get(cur_obj);
|
||||
ck_assert_int_eq(pos, 10);
|
||||
|
||||
|
|
Loading…
Reference in New Issue