mirror of
https://github.com/d0zingcat/rime-ice.git
synced 2026-05-22 15:10:38 +00:00
删除限制码长
仅仅只是限制了字母个数,并没有完全阻挡因为拼写运算造成的卡顿,没什么意义。
This commit is contained in:
18
rime.lua
18
rime.lua
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user