vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit b50fe25254bc5530bc17cd0f693ca694fa297558
parent 81fed8fe83e67e4aca20cef941b37d225a0b186d
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Wed,  6 Jul 2016 12:55:00 +0200

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.

Diffstat:
Mvis.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 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;