删除限制码长

仅仅只是限制了字母个数,并没有完全阻挡因为拼写运算造成的卡顿,没什么意义。
This commit is contained in:
Dvel 2023-03-22 16:52:39 +08:00
parent 6628b320b5
commit 5251b4944e
4 changed files with 0 additions and 33 deletions

View File

@ -52,7 +52,6 @@ switches:
engine:
processors:
- lua_processor@select_character # 以词定字
- lua_processor@code_length_limit_processor # 限制码长
- ascii_composer
- recognizer
- key_binder
@ -81,10 +80,6 @@ engine:
- uniquifier # 去重
# Lua 配置: 限制码长,默认 100。最多能输入的字符个数
code_length_limit_processor: 100
# Lua 配置: 日期、时间、星期、ISO 8601、时间戳的触发关键字
date_translator:
date: date # 日期: 2022-11-29

View File

@ -52,7 +52,6 @@ switches:
engine:
processors:
- lua_processor@select_character # 以词定字
- lua_processor@code_length_limit_processor # 限制码长
- ascii_composer
- recognizer
- key_binder
@ -81,10 +80,6 @@ engine:
- uniquifier # 去重
# Lua 配置: 限制码长,默认 100。最多能输入的字符个数
code_length_limit_processor: 100
# Lua 配置: 日期、时间、星期、ISO 8601、时间戳的触发关键字
date_translator:
date: date # 日期: 2022-11-29

View File

@ -275,24 +275,6 @@ function irime_t9_preedit(input, env)
end
end
-------------------------------------------------------------
-- 限制码长(最多能输入 length_limit 个字符,超过后不再上屏,不设置时默认 100
-- 参考于https://github.com/rime/weasel/issues/733
function code_length_limit_processor(key, env)
local ctx = env.engine.context
local config = env.engine.schema.config
-- 限制
local length_limit = config:get_int(env.name_space) or 100
if (length_limit ~= nil) then
if (string.len(ctx.input) > length_limit) then
-- ctx:clear()
ctx:pop_input(1) -- 删除输入框中最后个编码字符
return 1
end
end
-- 放行
return 2
end
-------------------------------------------------------------
-- Unicode 输入
-- 复制自: https://github.com/shewer/librime-lua-script/blob/main/lua/component/unicode.lua
function unicode(input, seg, env)

View File

@ -43,7 +43,6 @@ switches:
engine:
processors:
- lua_processor@select_character # 以词定字
- lua_processor@code_length_limit_processor # 限制码长
- ascii_composer
- recognizer
- key_binder
@ -75,10 +74,6 @@ engine:
- uniquifier # 去重
# Lua 配置: 限制码长,默认 100。最多能输入的字符个数
code_length_limit_processor: 100
# Lua 配置: 日期、时间、星期、ISO 8601、时间戳的触发关键字
date_translator:
date: rq # 日期: 2022-11-29