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-15 14:47:26 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-15 14:47:26 -0700
commit8a6d3ce799e18774e1ef40af1127359fa2236808 (patch)
tree6fb7097050356bd0a55ab297f92f2721390c2640 /main.lua
parent4158eee7f6667bdf24a6109e086ea3a819a6eb1c (diff)
downloadtext.love-8a6d3ce799e18774e1ef40af1127359fa2236808.tar.gz
delete drawing using backspace
I solemnly swear that I am aware of the risk of data loss..
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.lua b/main.lua
index e865193..c56a290 100644
--- a/main.lua
+++ b/main.lua
@@ -471,6 +471,8 @@ function keychord_pressed(chord)
   elseif chord == 'backspace' then
     if #lines > 1 and lines[#lines] == '' then
       table.remove(lines)
+    elseif type(lines[#lines]) == 'table' then
+      table.remove(lines)  -- we'll add undo soon
     else
       local byteoffset = utf8.offset(lines[#lines], -1)
       if byteoffset then