about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-09-03 17:15:25 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-09-03 17:15:25 -0700
commit21efba975d9ca75a56f9f6a6cd058b13bb63ae15 (patch)
treec6f85364cc2befa619efbc519890c1788776a061
parent9fe2af3e340ad4bf5d040e6d06b2eea39b7d45bd (diff)
parent5cada8cc9e0ac94ef6fdc1e7eb7be906ae367cd6 (diff)
downloadtext.love-21efba975d9ca75a56f9f6a6cd058b13bb63ae15.tar.gz
Merge lines.love
-rw-r--r--main.lua4
-rw-r--r--run.lua8
-rw-r--r--source_file.lua10
3 files changed, 7 insertions, 15 deletions
diff --git a/main.lua b/main.lua
index 00a6af9..9b6abf6 100644
--- a/main.lua
+++ b/main.lua
@@ -83,7 +83,7 @@ function App.initialize(arg)
   else
     assert(false, 'unknown app "'..Current_app..'"')
   end
-  love.window.setTitle('text.love - '..Current_app)
+  love.window.setTitle('lines.love - '..Current_app)
 end
 
 function App.resize(w,h)
@@ -105,7 +105,7 @@ function App.filedropped(file)
   else
     assert(false, 'unknown app "'..Current_app..'"')
   end
-  love.window.setTitle('text.love - '..Current_app)
+  love.window.setTitle('lines.love - '..Current_app)
 end
 
 function App.focus(in_focus)
diff --git a/run.lua b/run.lua
index d295afe..778dbf3 100644
--- a/run.lua
+++ b/run.lua
@@ -53,12 +53,12 @@ function run.load_settings()
   -- maximize window to determine maximum allowable dimensions
   App.screen.width, App.screen.height, App.screen.flags = love.window.getMode()
   -- set up desired window dimensions
-  love.window.setPosition(Settings.x, Settings.y, Settings.displayindex)
   App.screen.flags.resizable = true
   App.screen.flags.minwidth = math.min(App.screen.width, 200)
   App.screen.flags.minheight = math.min(App.screen.width, 200)
   App.screen.width, App.screen.height = Settings.width, Settings.height
   love.window.setMode(App.screen.width, App.screen.height, App.screen.flags)
+  love.window.setPosition(Settings.x, Settings.y, Settings.displayindex)
   Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right, Settings.font_height, math.floor(Settings.font_height*1.3))
   Editor_state.filename = Settings.filename
   Editor_state.screen_top1 = Settings.screen_top
@@ -129,13 +129,15 @@ function run.quit()
 end
 
 function run.settings()
-  local x,y,displayindex = love.window.getPosition()
+  if Current_app == 'run' then
+    Settings.x, Settings.y, Settings.displayindex = love.window.getPosition()
+  end
   local filename = Editor_state.filename
   if filename:sub(1,1) ~= '/' then
     filename = love.filesystem.getWorkingDirectory()..'/'..filename  -- '/' should work even on Windows
   end
   return {
-    x=x, y=y, displayindex=displayindex,
+    x=Settings.x, y=Settings.y, displayindex=Settings.displayindex,
     width=App.screen.width, height=App.screen.height,
     font_height=Editor_state.font_height,
     filename=filename,
diff --git a/source_file.lua b/source_file.lua
index 978e949..9c0b8a4 100644
--- a/source_file.lua
+++ b/source_file.lua
@@ -56,16 +56,6 @@ function save_to_disk(State)
   outfile:close()
 end
 
-function file_exists(filename)
-  local infile = App.open_for_reading(filename)
-  if infile then
-    infile:close()
-    return true
-  else
-    return false
-  end
-end
-
 -- for tests
 function load_array(a)
   local result = {}