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:26:15 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-17 22:26:15 -0700
commit82742330f8760865bbfc21705a809dcb61403d7d (patch)
tree6412030a2c6f8e6c3f2b3efc6f8e2b2aa49d9de4 /main.lua
parent23176de0e045db6592d22981010e74b360d52cc9 (diff)
downloadlines.love-82742330f8760865bbfc21705a809dcb61403d7d.tar.gz
autosave in a couple more places
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.lua b/main.lua
index 8efcc33..884a2cf 100644
--- a/main.lua
+++ b/main.lua
@@ -268,6 +268,7 @@ function keychord_pressed(chord)
     Lines[Cursor_line].data = string.sub(Lines[Cursor_line].data, 1, byte_offset-1)
     Cursor_line = Cursor_line+1
     Cursor_pos = 1
+    save_to_disk(Lines, Filename)
   elseif chord == 'left' then
     assert(Lines[Cursor_line].mode == 'text')
     if Cursor_pos > 1 then
@@ -326,6 +327,7 @@ function keychord_pressed(chord)
       end
       Cursor_line = Cursor_line-1
     end
+    save_to_disk(Lines, Filename)
   elseif chord == 'delete' then
     if Cursor_pos <= #Lines[Cursor_line].data then
       local byte_start = utf8.offset(Lines[Cursor_line].data, Cursor_pos)
@@ -347,6 +349,7 @@ function keychord_pressed(chord)
         table.remove(Lines, Cursor_line+1)
       end
     end
+    save_to_disk(Lines, Filename)
   elseif chord == 'up' then
     assert(Lines[Cursor_line].mode == 'text')
     local new_cursor_line = Cursor_line