From d6ec134f3d50f8ff21a80a0fdbaecce8931ee7d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Mon, 2 Nov 2015 18:29:52 +0100 Subject: text: return end of changed range in text_redo This affects the cursor placement when redoing changes in single cursor mode. Closes #42 --- text.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'text.c') diff --git a/text.c b/text.c index e8e08ee..a7016ca 100644 --- 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; } -- cgit v1.2.3