2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00

inputtext: fix deleting a word by backspace swipe north

This commit is contained in:
hius07 2024-08-31 10:48:08 +03:00 committed by Frans de Jonge
parent 60e0e3ef45
commit 84ed68ba82

View File

@ -917,6 +917,7 @@ function InputText:delWord(left_to_cursor)
return return
end end
local start_pos, end_pos = self:getStringPos(true, left_to_cursor) local start_pos, end_pos = self:getStringPos(true, left_to_cursor)
start_pos = math.min(start_pos, end_pos)
for i = end_pos, start_pos, -1 do for i = end_pos, start_pos, -1 do
table.remove(self.charlist, i) table.remove(self.charlist, i)
end end