about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/lua.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lua.c b/src/lua.c
index 04cbbaa..b0662f7 100644
--- a/src/lua.c
+++ b/src/lua.c
@@ -625,13 +625,10 @@ void add_undo_event(lua_State *L, int cursor) {
   lua_rawseti(L, history_array, history_array_size);
   /* clean up */
   lua_pop(L, 1);
-  /* persist */
-  save_image(L);
 }
 
 
 // TODO:
-//  jump to current change
 //  add a note
 void recent_changes (lua_State *L) {
   lua_getglobal(L, "teliva_program");
@@ -660,8 +657,10 @@ void recent_changes (lua_State *L) {
         if (cursor < history_array_size) ++cursor;
         break;
       case CTRL_U:
-        if (cursor < history_array_size)
+        if (cursor < history_array_size) {
           add_undo_event(L, cursor);
+          save_image(L);
+        }
         break;
     }
     lua_pop(L, 1);