From ec9007f0512930bc16f23e97ea626799187700b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 21 Feb 2017 14:47:05 +0100 Subject: sam: make sure all commands can be undone Take a snapshot before and after processing the transcript. --- sam.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sam.c') 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) { -- cgit v1.2.3