From b0bcb5307becea40247c79d556677c948fb8ff35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 27 Sep 2014 15:22:07 +0200 Subject: Simplify text_line_finish --- text-motions.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'text-motions.c') diff --git a/text-motions.c b/text-motions.c index 997d3c1..3dbd4c5 100644 --- a/text-motions.c +++ b/text-motions.c @@ -25,8 +25,6 @@ static int is_word_boundry(int c) { ('A' <= c && c <= 'Z')); } -// TODO: consistent usage of iterators either char or byte based where appropriate. - size_t text_begin(Text *txt, size_t pos) { return 0; } @@ -126,10 +124,8 @@ size_t text_line_start(Text *txt, size_t pos) { size_t text_line_finish(Text *txt, size_t pos) { char c; Iterator it = text_iterator_get(txt, text_line_end(txt, pos)); - do text_iterator_byte_prev(&it, NULL); + do text_iterator_char_prev(&it, NULL); while (text_iterator_byte_get(&it, &c) && c != '\n' && isspace(c)); - if (!ISUTF8(c)) - text_iterator_char_prev(&it, NULL); return it.pos; } -- cgit v1.2.3