删除限制码长

仅仅只是限制了字母个数,并没有完全阻挡因为拼写运算造成的卡顿,没什么意义。
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

@@ -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)