mirror of
https://github.com/d0zingcat/rime_wanxiang.git
synced 2026-05-13 23:16:54 +00:00
fix: 修复当根目录的置顶包含英文的时候导致replacer简码也会出现的问题
This commit is contained in:
@@ -974,10 +974,10 @@
|
||||
符号:≈ 约等号
|
||||
符号:≠ 不等于
|
||||
符号:≠ 不等号
|
||||
符号:≤ 小于号
|
||||
符号:<≤> 小于号
|
||||
符号:≤ 小于等于
|
||||
符号:≤ 小于等于号
|
||||
符号:≥ 大于号
|
||||
符号:> 大于号
|
||||
符号:≥ 大于等于
|
||||
符号:≥ 大于等于号
|
||||
符号:吋 英寸
|
||||
|
||||
@@ -528,26 +528,40 @@ function M.func(input, env)
|
||||
end
|
||||
end
|
||||
-- [Main Loop] 主循环
|
||||
local pending_cands = {}
|
||||
local limit = 10
|
||||
local has_phrase = false
|
||||
local cand_count = 0
|
||||
|
||||
|
||||
for cand in input:iter() do
|
||||
cand_count = cand_count + 1
|
||||
|
||||
if cand_count == 1 then
|
||||
-- 判断是否为"空码" (raw / english / 纯字母 / 文本等于输入)
|
||||
local has_letter = string.find(cand.text, "[a-zA-Z]")
|
||||
local is_empty = (cand.type == "raw"
|
||||
or cand.type == "english"
|
||||
or cand.text == input_code
|
||||
or has_letter) -- 只要包含字母,就算作空
|
||||
try_trigger_abbrev(is_empty)
|
||||
|
||||
if cand_count <= limit then
|
||||
table.insert(pending_cands, cand)
|
||||
if cand.type == "phrase" then
|
||||
has_phrase = true
|
||||
end
|
||||
else
|
||||
if cand_count == limit + 1 then
|
||||
if not has_phrase then
|
||||
try_trigger_abbrev(true)
|
||||
end
|
||||
for _, pc in ipairs(pending_cands) do
|
||||
process_rules(pc)
|
||||
end
|
||||
pending_cands = nil
|
||||
end
|
||||
process_rules(cand)
|
||||
end
|
||||
|
||||
-- 原候选逻辑
|
||||
process_rules(cand)
|
||||
end
|
||||
if cand_count == 0 then
|
||||
try_trigger_abbrev(true)
|
||||
|
||||
if pending_cands then
|
||||
if not has_phrase then
|
||||
try_trigger_abbrev(true)
|
||||
end
|
||||
for _, pc in ipairs(pending_cands) do
|
||||
process_rules(pc)
|
||||
end
|
||||
end
|
||||
end
|
||||
return M
|
||||
Reference in New Issue
Block a user