about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-07-10 17:16:58 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-07-10 17:16:58 -0700
commitbca7f8259802d6f6751dbe265dc0b27d7fac7589 (patch)
tree77193a5afe2782f73e2494fed3136ef74a24361b
parent7f4c5f847b1e7e812d0abc255444b70341e4a827 (diff)
downloadtext.love-bca7f8259802d6f6751dbe265dc0b27d7fac7589.tar.gz
standardize between run and source some more
We shouldn't be thinking about saving settings when we're initializing
window geometry.
-rw-r--r--run.lua4
-rw-r--r--source.lua6
2 files changed, 3 insertions, 7 deletions
diff --git a/run.lua b/run.lua
index 9a90b61..dea19cd 100644
--- a/run.lua
+++ b/run.lua
@@ -150,9 +150,7 @@ function run.quit()
 end
 
 function run.settings()
-  if Settings == nil then
-    Settings = {}
-  end
+  if Settings == nil then Settings = {} end
   Settings.x, Settings.y, Settings.displayindex = App.screen.position()
   return {
     x=Settings.x, y=Settings.y, displayindex=Settings.displayindex,
diff --git a/source.lua b/source.lua
index cfd38fa..4768865 100644
--- a/source.lua
+++ b/source.lua
@@ -179,10 +179,6 @@ function source.initialize_window_geometry(em_width)
   App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
   App.screen.flags.resizable = true
   App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
-  print('initializing source position')
-  if Settings == nil then Settings = {} end
-  if Settings.source == nil then Settings.source = {} end
-  Settings.source.x, Settings.source.y, Settings.source.displayindex = App.screen.position()
 end
 
 function source.resize(w, h)
@@ -273,6 +269,8 @@ function source.quit()
 end
 
 function source.settings()
+  if Settings == nil then Settings = {} end
+  if Settings.source == nil then Settings.source = {} end
   Settings.source.x, Settings.source.y, Settings.source.displayindex = App.screen.position()
   File_navigation.cursors[Editor_state.filename] = {cursor1=Editor_state.cursor1, screen_top1=Editor_state.screen_top1}
   return {