From 5251b4944ed0b2f949e6ef307d2ded64ffcebdda Mon Sep 17 00:00:00 2001 From: Dvel Date: Wed, 22 Mar 2023 16:52:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=99=90=E5=88=B6=E7=A0=81?= =?UTF-8?q?=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 仅仅只是限制了字母个数,并没有完全阻挡因为拼写运算造成的卡顿,没什么意义。 --- double_pinyin.schema.yaml | 5 ----- double_pinyin_flypy.schema.yaml | 5 ----- rime.lua | 18 ------------------ rime_ice.schema.yaml | 5 ----- 4 files changed, 33 deletions(-) diff --git a/double_pinyin.schema.yaml b/double_pinyin.schema.yaml index a693069..cee90cb 100755 --- a/double_pinyin.schema.yaml +++ b/double_pinyin.schema.yaml @@ -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 diff --git a/double_pinyin_flypy.schema.yaml b/double_pinyin_flypy.schema.yaml index bda6773..a42f7c2 100755 --- a/double_pinyin_flypy.schema.yaml +++ b/double_pinyin_flypy.schema.yaml @@ -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 diff --git a/rime.lua b/rime.lua index 3450320..96b7070 100755 --- a/rime.lua +++ b/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) diff --git a/rime_ice.schema.yaml b/rime_ice.schema.yaml index 43ee745..2ac2a91 100755 --- a/rime_ice.schema.yaml +++ b/rime_ice.schema.yaml @@ -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