vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit a4194b1efbf7d230fcb11ba8fd452e27e9e84f92 parent 037cce7d94272b0c9a313569ddfd92f6aa16279c Author: Marc André Tanner <mat@brain-dump.org> Date: Wed, 3 Feb 2016 12:32:46 +0100 text-object: fix bugs in outer word `aw` implementation Diffstat:
| M | text-objects.c | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/text-objects.c b/text-objects.c @@ -126,7 +126,7 @@ Filerange text_object_word(Text *txt, size_t pos) { } else { /* on a single character */ r.start = pos; - r.end = text_char_next(txt, pos); + r.end = text_word_start_next(txt, pos); } } else if (isboundry(prev)) { /* at start of a word */ @@ -157,7 +157,7 @@ Filerange text_object_word_outer(Text *txt, size_t pos) { if (isspace((unsigned char)c)) { /* middle of two words, include leading white space */ r.start = text_char_next(txt, text_word_end_prev(txt, pos)); - r.end = text_word_end_next(txt, pos); + r.end = text_char_next(txt, text_word_end_next(txt, pos)); } else if (isboundry(prev) && isboundry(next)) { if (isboundry(c)) { r.start = text_char_next(txt, text_word_end_prev(txt, pos));