textedit correction

Changes to be committed:
	modified:   src/ltui/textedit.lua
This commit is contained in:
laelnasan
2020-12-05 12:25:52 -03:00
parent 96f1aa0cdf
commit 9e6516e257

View File

@@ -88,7 +88,7 @@ function textedit:on_event(e)
if #text > 0 then if #text > 0 then
local size = 1 local size = 1
-- while continuation byte -- while continuation byte
while (text:byte(#text - size) & 0xc0) == 0x80 do while (text:byte(#text - size + 1) & 0xc0) == 0x80 do
size = size + 1 size = size + 1
end end
self:text_set(text:sub(1, #text - size)) self:text_set(text:sub(1, #text - size))