about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-06-27 17:36:10 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-06-27 17:36:10 -0700
commit938e3ca1bb1ab20a6f0743121e1e60960efdfa64 (patch)
treeb2563ec81eba24de693c8d40d199fca3bb4595a1 /main.lua
parente63878897ef09ee0eb932c50eee2befe3402e192 (diff)
downloadtext.love-938e3ca1bb1ab20a6f0743121e1e60960efdfa64.tar.gz
when naming points, allow backspacing back to ''
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.lua b/main.lua
index 71c7e4d..22ef6e7 100644
--- a/main.lua
+++ b/main.lua
@@ -552,6 +552,7 @@ function App.keychord_pressed(chord, key)
       elseif chord == 'backspace' then
         local len = utf8.len(p.name)
         local byte_offset = Text.offset(p.name, len-1)
+        if len == 1 then byte_offset = 0 end
         p.name = string.sub(p.name, 1, byte_offset)
         record_undo_event({before=before, after=snapshot(Lines.current_drawing_index)})
       end