diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-06-29 17:58:58 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-06-29 17:58:58 -0700 |
commit | d009390cc4fa891d8c6399e12bb83567606156e2 (patch) | |
tree | 6a199e5cc448b1056209d6d5a76290d2a2c025a1 /main.lua | |
parent | bfbe73e0efd2f80d5a2402ced3a93d6748319fbd (diff) | |
download | text.love-d009390cc4fa891d8c6399e12bb83567606156e2.tar.gz |
bugfix: save previous file when dropping a new one on
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 5 |
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') |