From 68acdb8614b229b0cdc6b62c86505fcf3823841c Mon Sep 17 00:00:00 2001 From: amzxyz Date: Sun, 11 Jan 2026 11:06:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=A8=E6=8B=BC=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=B8=8B=E5=B0=86bun=E6=8B=BC=E9=9F=B3=E4=B8=8B=E7=BD=AE?= =?UTF-8?q?=E9=A1=B6=E4=B8=80=E4=B8=AA=E2=80=9C=E4=B8=8D=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E7=94=9F=E5=83=BB=E5=AD=97=E5=85=BA=E5=B9=B2?= =?UTF-8?q?=E6=89=B0=E5=96=9C=E6=AC=A2=E6=B4=BE=E7=94=9F=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E7=9A=84=E4=B9=A0=E6=83=AF=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/super_filter.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lua/super_filter.lua b/lua/super_filter.lua index a4b2cde..eeeb178 100644 --- a/lua/super_filter.lua +++ b/lua/super_filter.lua @@ -488,7 +488,9 @@ end -- is_english : 函数(cand) → bool local function emit_with_pipeline(cand, ctxs) if not cand then return end - + if ctxs.pinned_set and ctxs.pinned_set[cand.text] then + return + end local env = ctxs.env -- ① 字符集过滤:只有在 charset_strict = true 时才启用 @@ -611,7 +613,18 @@ function M.func(input, env) en_only = ctx:get_option("en_only") or false zh_only = ctx:get_option("zh_only") or false end - + -- 全拼输入 bun 置顶“不能”逻辑 + local pinned_set = nil + if code == "bun" then + local s_id = wanxiang.get_input_method_type(env) + if s_id == "pinyin" then + local text = "不能" + local c = Candidate("fixed", 0, #code, text, "") + c.preedit = "bu n" + yield(c) + pinned_set = { [text] = true } -- 记录到表中,供 emit_with_pipeline 去重 + end + end local function unify_tail_span(c) if fully_consumed and wrap_key and last_seg and c and c._end ~= last_seg._end then local nc = Candidate(c.type, c.start, last_seg._end, c.text, c.comment)