aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-07-06 12:55:00 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-07-06 13:13:05 +0200
commit819ef09d1cd9e77a3ffb681fb2e8508e62ffef1c (patch)
treecc19a5f358377728ada5c05aa25f5f255c03b4f6
parentc61e4091d0d1bc9a3af2f11034f2c0716d302d99 (diff)
downloadvis-819ef09d1cd9e77a3ffb681fb2e8508e62ffef1c.tar.gz
vis-819ef09d1cd9e77a3ffb681fb2e8508e62ffef1c.tar.xz
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.
-rw-r--r--vis.c6
1 files 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;