From 6267ddd2eb2f3e1def0555e4968681a1c094f0a0 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 4 Jun 2022 22:13:34 -0700 Subject: bugfix: backspace from start of file --- text.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/text.lua b/text.lua index 7302a0a..79d3675 100644 --- a/text.lua +++ b/text.lua @@ -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 -- cgit 1.4.1-2-gfad0