diff --git a/code/ui/prompt.lua b/code/ui/prompt.lua index fc0bf7d..36ea8b1 100644 --- a/code/ui/prompt.lua +++ b/code/ui/prompt.lua @@ -4,10 +4,10 @@ local function backspace(text) local byteoffset = utf8.offset(text, -1) if byteoffset then - -- remove the last UTF-8 character. - -- string.sub operates on bytes rather than UTF-8 characters, - -- so we couldn't do string.sub(text, 1, -2). - return string.sub(text, 1, byteoffset - 1) + -- remove the last UTF-8 character. + -- string.sub operates on bytes rather than UTF-8 characters, + -- so we couldn't do string.sub(text, 1, -2). + return string.sub(text, 1, byteoffset - 1) end return ""