aboutsummaryrefslogtreecommitdiff
path: root/text-motions.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-27 15:22:07 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-27 15:22:07 +0200
commitb0bcb5307becea40247c79d556677c948fb8ff35 (patch)
treee5318f39bd5d3c75fde235333948d04795d341a3 /text-motions.c
parent83acb5c15dd2cd49224842bfcd2c2ba5ad761a85 (diff)
downloadvis-b0bcb5307becea40247c79d556677c948fb8ff35.tar.gz
vis-b0bcb5307becea40247c79d556677c948fb8ff35.tar.xz
Simplify text_line_finish
Diffstat (limited to 'text-motions.c')
-rw-r--r--text-motions.c6
1 files changed, 1 insertions, 5 deletions
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;
}