about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.lua b/main.lua
index 63c0e8d..b63c7fc 100644
--- a/main.lua
+++ b/main.lua
@@ -190,6 +190,11 @@ function initialize_font_settings(font_height)
 end
 
 function App.filedropped(file)
+  -- first make sure to save edits on any existing file
+  if Next_save then
+    save_to_disk(Lines, Filename)
+  end
+  -- clear the slate for the new file
   App.initialize_globals()  -- in particular, forget all undo history
   Filename = file:getFilename()
   file:open('r')