delete drawing using backspace

I solemnly swear that I am aware of the risk of data loss..
This commit is contained in:
Kartik K. Agaram 2022-05-15 14:47:26 -07:00
parent 4158eee7f6
commit 8a6d3ce799

View File

@ -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