aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--text.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/text.c b/text.c
index ad422c5..a9685e4 100644
--- a/text.c
+++ b/text.c
@@ -550,6 +550,8 @@ bool text_insert(Text *txt, size_t pos, const char *data) {
size_t text_undo(Text *txt) {
size_t pos = -1;
+ /* taking a snapshot makes sure that txt->current_action is reset */
+ text_snapshot(txt);
Action *a = action_pop(&txt->undo);
if (!a)
return pos;