From 8b02ffe904a53509b3e99d3d6d8149c02cfefd23 Mon Sep 17 00:00:00 2001 From: Dvel Date: Fri, 10 Feb 2023 19:27:29 +0800 Subject: [PATCH] =?UTF-8?q?lua:=20=E8=B0=83=E6=95=B4=20v=20=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E6=95=B0=E5=AD=97=20Emoji=20=E5=9C=A8=E5=80=99?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E4=B8=AD=E7=9A=84=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rime.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rime.lua b/rime.lua index 80a5754..9c6adfd 100755 --- a/rime.lua +++ b/rime.lua @@ -196,9 +196,17 @@ function v_filter(input, env) local code = env.engine.context.input -- 当前编码 local l = {} for cand in input:iter() do - if (cand.text == "Vs.") then -- 特殊情况处理 + -- 特殊情况处理 + if (cand.text == "Vs.") then yield(cand) end + -- 特殊情况处理 + local arr = {"1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣"} + for _, v in ipairs(arr) do + if (v == cand.text and string.len(code) == 2 and string.find(code, "v") == 1) then + yield(cand) + end + end -- 以 v 开头、2 个长度的编码、候选项为单个字符的,提到前面来。 if (string.len(code) == 2 and string.find(code, "v") == 1 and utf8.len(cand.text) == 1) then yield(cand)