日常更新; fix #315

This commit is contained in:
Dvel
2023-05-31 21:12:37 +08:00
parent b6d39175b0
commit 7a3eb8ab80
8 changed files with 98 additions and 69 deletions

View File

@@ -56,20 +56,20 @@ local function select_character(key, env)
local first_key = config:get_string('key_binder/select_first_character')
local last_key = config:get_string('key_binder/select_last_character')
if (key:repr() == first_key) then
if(context:get_selected_candidate().text)then
engine:commit_text(utf8_sub(context:get_selected_candidate().text, 1, 1))
context:clear()
if context:has_menu() then
if (key:repr() == first_key) then
if (context:get_selected_candidate().text) then
engine:commit_text(utf8_sub(context:get_selected_candidate().text, 1, 1))
context:clear()
end
return 1 -- kAccepted
elseif (key:repr() == last_key) then
if (context:get_selected_candidate().text) then
engine:commit_text(utf8_sub(context:get_selected_candidate().text, -1, -1))
context:clear()
end
return 1 -- kAccepted
end
return 1 -- kAccepted
end
if (key:repr() == last_key) then
if(context:get_selected_candidate().text)then
engine:commit_text(utf8_sub(context:get_selected_candidate().text,-1,-1))
context:clear()
end
return 1 -- kAccepted
end
return 2 -- kNoop