about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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