aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-02-21 14:47:05 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-02-21 14:50:34 +0100
commitec9007f0512930bc16f23e97ea626799187700b6 (patch)
tree83ab567d62619664340a3ac6c9c849a07d427965
parentba55c3974df68bff8941bc32470fb3a6dac1e26d (diff)
downloadvis-ec9007f0512930bc16f23e97ea626799187700b6.tar.gz
vis-ec9007f0512930bc16f23e97ea626799187700b6.tar.xz
sam: make sure all commands can be undone
Take a snapshot before and after processing the transcript.
-rw-r--r--sam.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sam.c b/sam.c
index d1cc637..fc41e57 100644
--- 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) {