about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lua.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lua.c b/src/lua.c
index b17b7db..6362c38 100644
--- a/src/lua.c
+++ b/src/lua.c
@@ -404,6 +404,7 @@ static int handle_image (lua_State *L, char **argv, int n) {
 char Current_definition[CURRENT_DEFINITION_LEN+1] = {0};
 
 void save_editor_state (int rowoff, int coloff, int cy, int cx) {
+  if (strlen(Current_definition) == 0) return;
   FILE *out = fopen("teliva_editor_state", "w");
   fprintf(out, "__teliva_editor_state = {\n");
   fprintf(out, "  image = \"%s\", definition = \"%s\",\n", Image_name, Current_definition);