From 9803932e3d702e2cdc654501d9fd4cb2c7fac491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 3 Feb 2016 12:32:46 +0100 Subject: text-object: fix bugs in outer word `aw` implementation --- text-objects.c | 4 ++-- 1 file 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)); -- cgit v1.2.3