From 0726692546c16c16344c8fcdc21942e999d52ea9 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 26 Nov 2021 19:45:19 -0800 Subject: more obvious serialization of undo events --- src/lua.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lua.c b/src/lua.c index 7662a55..d34b902 100644 --- a/src/lua.c +++ b/src/lua.c @@ -453,6 +453,10 @@ static void save_image (lua_State *L) { fprintf(out, " {\n"); for (lua_pushnil(L); lua_next(L, table) != 0; lua_pop(L, 1)) { const char* key = lua_tostring(L, -2); + if (strcmp(key, "__teliva_undo") == 0) { + fprintf(out, " %s = %d\n", key, lua_tointeger(L, -1)); + continue; + } const char* value = lua_tostring(L, -1); fprintf(out, " %s = [==[\n", key); fprintf(out, "%s", value); -- cgit 1.4.1-2-gfad0