vis

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

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

commit 02e696eb2a5493b36e0155fb9ef9920db3dab716
parent db1742e3947cb520680d279dfae830e21f9af96e
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Tue, 21 Feb 2017 14:47:05 +0100

sam: make sure all commands can be undone

Take a snapshot before and after processing the transcript.

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

diff --git a/sam.c b/sam.c @@ -1137,6 +1137,7 @@ enum SamError sam_cmd(Vis *vis, const char *s) { err = t->error; continue; } + vis_file_snapshot(vis, file); ptrdiff_t delta = 0; for (Change *c = t->changes; c; c = c->next) { c->range.start += delta; @@ -1176,6 +1177,7 @@ enum SamError sam_cmd(Vis *vis, const char *s) { } } sam_transcript_free(&file->transcript); + vis_file_snapshot(vis, file); } if (vis->win) {