bugfix: backspace from start of file

This commit is contained in:
Kartik K. Agaram 2022-06-04 22:13:34 -07:00
parent 778bc78416
commit 6267ddd2eb
1 changed files with 1 additions and 4 deletions

View File

@ -182,10 +182,6 @@ function Text.keychord_pressed(chord)
local before
if Cursor1.pos > 1 then
before = snapshot(Cursor1.line)
else
before = snapshot(Cursor1.line-1, Cursor1.line)
end
if Cursor1.pos > 1 then
local byte_start = utf8.offset(Lines[Cursor1.line].data, Cursor1.pos-1)
local byte_end = utf8.offset(Lines[Cursor1.line].data, Cursor1.pos)
if byte_start then
@ -198,6 +194,7 @@ function Text.keychord_pressed(chord)
Cursor1.pos = Cursor1.pos-1
end
elseif Cursor1.line > 1 then
before = snapshot(Cursor1.line-1, Cursor1.line)
if Lines[Cursor1.line-1].mode == 'drawing' then
table.remove(Lines, Cursor1.line-1)
else