From 819ef09d1cd9e77a3ffb681fb2e8508e62ffef1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 6 Jul 2016 12:55:00 +0200 Subject: vis: fix inner text object variants when cursor is on opening delimiter Except for special cases like gn and gN vis expected that a text object would be a function mapping a position to a range as follows: f: pos -> [start, end] with start <= f(pos) <= end Clearly this condition does not hold for inner text objects when the initial position i.e. the cursor is on the opening delimiter. This also obsoletes the need for the SPLIT text object flag which should be removed in a later commit if the current behavior is found to be working as expected. --- vis.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vis.c b/vis.c index 581adcd..ff212cc 100644 --- a/vis.c +++ b/vis.c @@ -643,10 +643,10 @@ void action_do(Vis *vis, Action *a) { r.end++; } - if (a->textobj->type & SPLIT) - c.range = r; - else + if (vis->mode->visual) c.range = text_range_union(&c.range, &r); + else + c.range = r; if (i < count - 1) pos = c.range.end + 1; -- cgit v1.2.3