aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-02-03 12:32:46 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-02-03 16:22:44 +0100
commit9803932e3d702e2cdc654501d9fd4cb2c7fac491 (patch)
treead20c93f2e1066fcb1cae11241e43bbb6f7d292d
parentb4f1609e637dba2405c7c8de0dcdc86e2fac0752 (diff)
downloadvis-9803932e3d702e2cdc654501d9fd4cb2c7fac491.tar.gz
vis-9803932e3d702e2cdc654501d9fd4cb2c7fac491.tar.xz
text-object: fix bugs in outer word `aw` implementation
-rw-r--r--text-objects.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/text-objects.c b/text-objects.c
index a85d70f..c9a60d3 100644
--- 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));