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.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.lua b/main.lua
index 9e0f886..3898bc1 100644
--- a/main.lua
+++ b/main.lua
@@ -264,11 +264,18 @@ function schedule_save()
   end
 end
 
--- make sure to save before quitting
 function love.quit()
+  -- make sure to save before quitting
   if Next_save then
     save_to_disk(Lines, Filename)
   end
+  -- save some important settings
+  local x,y,displayindex = love.window.getPosition()
+  local settings = {
+    x=x, y=y, displayindex=displayindex,
+    width=App.screen.width, height=App.screen.height,
+    font_height=Font_height, filename=Filename, screen_top=Screen_top1, cursor=Cursor1}
+  love.filesystem.write('config', json.encode(settings))
 end
 
 function App.mousepressed(x,y, mouse_button)