aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-08-28 15:07:11 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-08-28 15:07:11 +0200
commite2662dc195e8666beb5bed4cf0f50cfeb5e3df10 (patch)
tree54d430f33ad1f9e142cc60a7b8ea16aafad7ba35
parent43dbab6a9ca5392fded40bc7767a6f325d0a26c9 (diff)
downloadvis-e2662dc195e8666beb5bed4cf0f50cfeb5e3df10.tar.gz
vis-e2662dc195e8666beb5bed4cf0f50cfeb5e3df10.tar.xz
motion: fix movement to previous word end when right before
-rw-r--r--text-motions.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/text-motions.c b/text-motions.c
index 4dc094a..e57738c 100644
--- a/text-motions.c
+++ b/text-motions.c
@@ -81,7 +81,7 @@ size_t text_line_finish(Text *txt, size_t pos) {
do text_iterator_byte_prev(&it, NULL);
while (text_iterator_byte_get(&it, &c) && c != '\n' && c != '\r' && isspace(c));
if (!isutf8(c))
- text_iterator_char_prev(&it, &c);
+ text_iterator_char_prev(&it, NULL);
return it.pos;
}
@@ -118,7 +118,8 @@ size_t text_word_boundry_end_next(Text *txt, size_t pos, int (*isboundry)(int))
size_t text_word_boundry_end_prev(Text *txt, size_t pos, int (*isboundry)(int)) {
char c;
Iterator it = text_iterator_get(txt, pos);
- while (text_iterator_byte_prev(&it, &c) && !isboundry(c));
+ while (text_iterator_byte_get(&it, &c) && !isboundry(c))
+ text_iterator_byte_prev(&it, NULL);
while (text_iterator_char_prev(&it, &c) && isboundry(c));
return it.pos;
}