Skip to content

Commit

Permalink
- 修复英文模式无法输入的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Saimoecat committed Nov 20, 2024
1 parent 5d71cbf commit 1b8e95f
Show file tree
Hide file tree
Showing 6 changed files with 1,693 additions and 279 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ TAB</kbd>键直接将候选项和预测的词一起上屏。

<img src="./images/输入方式-长词联想.png" alt="长词联想">

- 带有<code></code>标识的即是用户词库的词
- 带有<code></code>标识的即是用户词库的词

## 码元及键位

Expand Down
12 changes: 7 additions & 5 deletions lua/desc_filter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ local function pinCandidate (env,inp,cand)
end

-- 普通候选词
local function ordinaryCandidate (env,inp,cand)

local function ordinaryCandidate (index,env,inp,cand)
env.countIndex = env.countIndex + 1
local flag = true

Expand Down Expand Up @@ -299,11 +298,11 @@ local function ordinaryCandidate (env,inp,cand)

cand.preedit = preedit

if (env.countIndex == 1 and string.find(cand.preedit, "²") == nil) then
if (index == 1 and #groups == 1) then
env.oneFlag = true
end

if (string.find(cand.preedit, "²") ~= nil or env.oneFlag ) then
if (flag == false or #groups > 1 or env.oneFlag ) then
return true
else
return false
Expand Down Expand Up @@ -352,6 +351,8 @@ local function filter(input, env)
--关闭文件
file:close()

local index = 0

-- 检查是否有置顶词
for cand in input:iter() do
local pinFlag = true
Expand All @@ -365,7 +366,8 @@ local function filter(input, env)
end

if (pinFlag) then
local ordinary = ordinaryCandidate(env,inp,cand)
index = index + 1
local ordinary = ordinaryCandidate(index,env,inp,cand)
if (ordinary) then
yield(cand)
end
Expand Down
4 changes: 2 additions & 2 deletions zrm.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ key_binder:

- { when: composing, accept: "Return", send: "Escape" }
#- { when: composing, accept: Tab, send: "Shift+Right" }
#- { when: composing, accept: Left, send: "Page_Up" }
#- { when: composing, accept: Right, send: "Page_Down" }
- { when: composing, accept: Up, send: "Page_Up" }
- { when: composing, accept: Down, send: "Page_Down" }
- { when: composing, accept: Shift+Shift_L, send: Shift+Left }
- { when: composing, accept: Shift+Shift_R, send: Shift+Right }

Expand Down
20 changes: 10 additions & 10 deletions zrm_fu.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ columns:
要不然 "0_

#右数字
_1
_2
_3
_4
_5
_6
_7
_8
_9
_0
0 _1
9 _2
8 _3
7 _4
6 _5
5 _6
4 _7
3 _8
2 _9
1 _0

#右数字空格
没什么 "_1
Expand Down
Loading

0 comments on commit 1b8e95f

Please sign in to comment.