2
0
mirror of https://github.com/koreader/koreader synced 2024-11-04 12:00:25 +00:00

Chinese keyboard: character level deletion apply to the last 2 chars

This commit is contained in:
weijiuqiao 2022-10-02 17:01:13 +08:00 committed by poire-z
parent 82d1381d49
commit 91e5123ff0

View File

@ -12,7 +12,7 @@ local function binarysearch( tbl, value, fcompval, reversed )
iMid = math.floor( (iStart+iEnd)/2 )
local value2 = fcompval( tbl[iMid] )
if value == value2 then
if iMid == 0 or fcompval( tbl[iMid-1] ) ~= value then
if iMid == 1 or fcompval( tbl[iMid-1] ) ~= value then
return iMid
end
iEnd = iMid - 1
@ -313,6 +313,11 @@ function IME:wrappedAddChars(inputbox, char)
if #imex.code > 0 then
imex.candi = {}
imex.char = ""
local previous_imex = _stack[#_stack-1]
if previous_imex then
previous_imex.candi = {}
previous_imex.char = ""
end
self:refreshHintChars(inputbox)
self:clear_stack()
else