fail_if(12 != evas_textblock_cursor_pos_get(cur));
evas_textblock_cursor_word_end(cur);
fail_if(18 != evas_textblock_cursor_pos_get(cur));
- evas_textblock_cursor_word_end(cur);
- fail_if(21 != evas_textblock_cursor_pos_get(cur));
/* Bug with 1 char word separators at paragraph start. */
evas_object_textblock_text_markup_set(tb, "=test");
evas_textblock_cursor_pos_set(cur, 4);
evas_textblock_cursor_word_start(cur);
fail_if(1 != evas_textblock_cursor_pos_get(cur));
+
+ /* 1 char words separated by spaces. */
+ evas_object_textblock_text_markup_set(tb, "a a a a");
+ evas_textblock_cursor_paragraph_first(cur);
+
+ evas_textblock_cursor_word_end(cur);
+ ck_assert_int_eq(0, evas_textblock_cursor_pos_get(cur));
+
+ evas_textblock_cursor_word_start(cur);
+ ck_assert_int_eq(0, evas_textblock_cursor_pos_get(cur));
+
+ evas_textblock_cursor_pos_set(cur, 2);
+ evas_textblock_cursor_word_start(cur);
+ ck_assert_int_eq(2, evas_textblock_cursor_pos_get(cur));
+ evas_textblock_cursor_word_end(cur);
+ ck_assert_int_eq(2, evas_textblock_cursor_pos_get(cur));
+
+ evas_textblock_cursor_pos_set(cur, 3);
+ evas_textblock_cursor_word_start(cur);
+ ck_assert_int_eq(2, evas_textblock_cursor_pos_get(cur));
+ evas_textblock_cursor_pos_set(cur, 3);
+ evas_textblock_cursor_word_end(cur);
+ ck_assert_int_eq(4, evas_textblock_cursor_pos_get(cur));
+
+ /* Going back when ending with whites. */
+ evas_object_textblock_text_markup_set(tb, "aa bla ");
+ evas_textblock_cursor_paragraph_last(cur);
+
+ evas_textblock_cursor_word_start(cur);
+ ck_assert_int_eq(3, evas_textblock_cursor_pos_get(cur));
+
+ evas_textblock_cursor_word_end(cur);
+ ck_assert_int_eq(5, evas_textblock_cursor_pos_get(cur));
}
/* Make sure coords are correct for ligatures */