vis

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

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

commit 718bdf2e15072cc4b6355b1073c00c8422eada3f
parent 407f32ddf8860e57aea41d40565171ab60d09169
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Mon,  2 Nov 2015 18:29:52 +0100

text: return end of changed range in text_redo

This affects the cursor placement when redoing changes in
single cursor mode.

Closes #42

Diffstat:
Mtext.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/text.c b/text.c @@ -680,6 +680,8 @@ static size_t action_redo(Text *txt, Action *a) { for ( ; c; c = c->prev) { span_swap(txt, &c->old, &c->new); pos = c->pos; + if (c->new.len > c->old.len) + pos += c->new.len - c->old.len; } return pos; }