-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
39,234 additions
and
40,476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
beta/schema/lua/yuhao/yuhao_autocompletion_filter_conditional.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--[[ Name: yuhao_autocompletion_filter_conditional.lua | ||
名稱: 輸入預測條件開啓 | ||
Version: 20240527 | ||
Author: forFudan 朱宇浩 <[email protected]> | ||
Github: https://github.com/forFudan/ | ||
Purpose: 當編碼長度小於等於四時,關閉輸入預測. | ||
版權聲明: | ||
專爲宇浩輸入法製作 <https://yuhao.forfudan.com> | ||
轉載請保留作者名和出處 | ||
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International | ||
--------------------------------------- | ||
]] | ||
|
||
local core = require("yuhao.yuhao_core") | ||
|
||
local function filter(input, env) | ||
local length_of_input = string.len(env.engine.context.input) | ||
if length_of_input <= 4 then | ||
for cand in input:iter() do | ||
if (cand.type == "completion") then | ||
return | ||
else | ||
yield(cand) | ||
end | ||
end | ||
else | ||
for cand in input:iter() do | ||
yield(cand) | ||
end | ||
end | ||
end | ||
|
||
return { func = filter } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.