fix: '%' 意外不上屏 fix #668

This commit is contained in:
Dvel 2024-02-06 18:19:21 +08:00
parent f3d92bddd0
commit 0956308908

View File

@ -108,12 +108,6 @@ function M.init(env)
end end
function M.func(input, env) function M.func(input, env)
-- If there is no configuration, no filtering will be performed
if not M.pin_cands then
for cand in input:iter() do yield(cand) end
return
end
-- 当前输入框的 preedit未经过方案 translator/preedit_format 转换 -- 当前输入框的 preedit未经过方案 translator/preedit_format 转换
-- 输入 nihaoshij 则为 nihaoshij选择了「你好」后变成 你好shij -- 输入 nihaoshij 则为 nihaoshij选择了「你好」后变成 你好shij
local full_preedit = env.engine.context:get_preedit().text local full_preedit = env.engine.context:get_preedit().text
@ -122,6 +116,12 @@ function M.func(input, env)
-- 是否正在选词(已经选择了至少一个字词,如 `你好shij` 这种状态) -- 是否正在选词(已经选择了至少一个字词,如 `你好shij` 这种状态)
-- local isSelecting = full_preedit ~= letter_only_preedit -- local isSelecting = full_preedit ~= letter_only_preedit
-- If there is no configuration, no filtering will be performed
if not M.pin_cands or #letter_only_preedit == 0 then
for cand in input:iter() do yield(cand) end
return
end
local pined = {} -- 提升的候选项 local pined = {} -- 提升的候选项
local others = {} -- 其余候选项 local others = {} -- 其余候选项
local pined_count = 0 local pined_count = 0