aboutsummaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-11-02 18:29:52 +0100
committerMarc André Tanner <mat@brain-dump.org>2015-11-02 19:37:50 +0100
commitd6ec134f3d50f8ff21a80a0fdbaecce8931ee7d7 (patch)
tree7c83fef4eb8801eb8fb40f0700e095d4118203d0 /text.c
parent7b07826a9b644f78de5395301d116a2c04e7c2f8 (diff)
downloadvis-d6ec134f3d50f8ff21a80a0fdbaecce8931ee7d7.tar.gz
vis-d6ec134f3d50f8ff21a80a0fdbaecce8931ee7d7.tar.xz
text: return end of changed range in text_redo
This affects the cursor placement when redoing changes in single cursor mode. Closes #42
Diffstat (limited to 'text.c')
-rw-r--r--text.c2
1 files changed, 2 insertions, 0 deletions
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;
}