From 82742330f8760865bbfc21705a809dcb61403d7d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 17 May 2022 22:26:15 -0700 Subject: [PATCH] autosave in a couple more places --- main.lua | 3 +++ 1 file changed, 3 insertions(+) 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