删除限制码长
仅仅只是限制了字母个数,并没有完全阻挡因为拼写运算造成的卡顿,没什么意义。
This commit is contained in:
parent
6628b320b5
commit
5251b4944e
@ -52,7 +52,6 @@ switches:
|
|||||||
engine:
|
engine:
|
||||||
processors:
|
processors:
|
||||||
- lua_processor@select_character # 以词定字
|
- lua_processor@select_character # 以词定字
|
||||||
- lua_processor@code_length_limit_processor # 限制码长
|
|
||||||
- ascii_composer
|
- ascii_composer
|
||||||
- recognizer
|
- recognizer
|
||||||
- key_binder
|
- key_binder
|
||||||
@ -81,10 +80,6 @@ engine:
|
|||||||
- uniquifier # 去重
|
- uniquifier # 去重
|
||||||
|
|
||||||
|
|
||||||
# Lua 配置: 限制码长,默认 100。(最多能输入的字符个数)
|
|
||||||
code_length_limit_processor: 100
|
|
||||||
|
|
||||||
|
|
||||||
# Lua 配置: 日期、时间、星期、ISO 8601、时间戳的触发关键字
|
# Lua 配置: 日期、时间、星期、ISO 8601、时间戳的触发关键字
|
||||||
date_translator:
|
date_translator:
|
||||||
date: date # 日期: 2022-11-29
|
date: date # 日期: 2022-11-29
|
||||||
|
@ -52,7 +52,6 @@ switches:
|
|||||||
engine:
|
engine:
|
||||||
processors:
|
processors:
|
||||||
- lua_processor@select_character # 以词定字
|
- lua_processor@select_character # 以词定字
|
||||||
- lua_processor@code_length_limit_processor # 限制码长
|
|
||||||
- ascii_composer
|
- ascii_composer
|
||||||
- recognizer
|
- recognizer
|
||||||
- key_binder
|
- key_binder
|
||||||
@ -81,10 +80,6 @@ engine:
|
|||||||
- uniquifier # 去重
|
- uniquifier # 去重
|
||||||
|
|
||||||
|
|
||||||
# Lua 配置: 限制码长,默认 100。(最多能输入的字符个数)
|
|
||||||
code_length_limit_processor: 100
|
|
||||||
|
|
||||||
|
|
||||||
# Lua 配置: 日期、时间、星期、ISO 8601、时间戳的触发关键字
|
# Lua 配置: 日期、时间、星期、ISO 8601、时间戳的触发关键字
|
||||||
date_translator:
|
date_translator:
|
||||||
date: date # 日期: 2022-11-29
|
date: date # 日期: 2022-11-29
|
||||||
|
18
rime.lua
18
rime.lua
@ -275,24 +275,6 @@ function irime_t9_preedit(input, env)
|
|||||||
end
|
end
|
||||||
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 输入
|
-- Unicode 输入
|
||||||
-- 复制自: https://github.com/shewer/librime-lua-script/blob/main/lua/component/unicode.lua
|
-- 复制自: https://github.com/shewer/librime-lua-script/blob/main/lua/component/unicode.lua
|
||||||
function unicode(input, seg, env)
|
function unicode(input, seg, env)
|
||||||
|
@ -43,7 +43,6 @@ switches:
|
|||||||
engine:
|
engine:
|
||||||
processors:
|
processors:
|
||||||
- lua_processor@select_character # 以词定字
|
- lua_processor@select_character # 以词定字
|
||||||
- lua_processor@code_length_limit_processor # 限制码长
|
|
||||||
- ascii_composer
|
- ascii_composer
|
||||||
- recognizer
|
- recognizer
|
||||||
- key_binder
|
- key_binder
|
||||||
@ -75,10 +74,6 @@ engine:
|
|||||||
- uniquifier # 去重
|
- uniquifier # 去重
|
||||||
|
|
||||||
|
|
||||||
# Lua 配置: 限制码长,默认 100。(最多能输入的字符个数)
|
|
||||||
code_length_limit_processor: 100
|
|
||||||
|
|
||||||
|
|
||||||
# Lua 配置: 日期、时间、星期、ISO 8601、时间戳的触发关键字
|
# Lua 配置: 日期、时间、星期、ISO 8601、时间戳的触发关键字
|
||||||
date_translator:
|
date_translator:
|
||||||
date: rq # 日期: 2022-11-29
|
date: rq # 日期: 2022-11-29
|
||||||
|
Loading…
x
Reference in New Issue
Block a user