about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-17 22:24:41 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-17 22:24:41 -0700
commit23176de0e045db6592d22981010e74b360d52cc9 (patch)
treeb312865d731e17e2ff9b9f7650df77d4f627aedb /main.lua
parent2241f33a8ffa40916a82e2c202fab31913176d99 (diff)
downloadtext.love-23176de0e045db6592d22981010e74b360d52cc9.tar.gz
assume we always have a filename
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua8
1 files changed, 2 insertions, 6 deletions
diff --git a/main.lua b/main.lua
index 6e20cc0..8efcc33 100644
--- a/main.lua
+++ b/main.lua
@@ -242,9 +242,7 @@ function love.mousereleased(x,y, button)
       Lines.current = nil
     end
   end
-  if Filename then
-    save_to_disk(Lines, Filename)
-  end
+  save_to_disk(Lines, Filename)
 end
 
 function love.textinput(t)
@@ -258,9 +256,7 @@ function love.textinput(t)
   end
   Lines[Cursor_line].data = string.sub(Lines[Cursor_line].data, 1, byte_offset)..t..string.sub(Lines[Cursor_line].data, byte_offset+1)
   Cursor_pos = Cursor_pos+1
-  if Filename then
-    save_to_disk(Lines, Filename)
-  end
+  save_to_disk(Lines, Filename)
 end
 
 function keychord_pressed(chord)