Skip to content

Commit e3f0a91

Browse files
Mintimatemirtlecn
andcommitted
fix(小鹤双拼): 修复触发字与key_binder冲突问题
resolved: #53 Co-Authored-By: mirtlecn <76689045+mirtlecn@users.noreply.github.com>
1 parent afd7d6c commit e3f0a91

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lua/auxCode_filter.lua

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
local AuxFilter = {}
88

9+
local function alt_lua_punc( s )
10+
return s:gsub( '([%.%+%-%*%?%[%]%^%$%(%)%%])', '%%%1' )
11+
end
12+
913
-- 日志模块
1014
-- local log = require 'log'
1115
-- log.outfile = "aux_code.log"
@@ -20,6 +24,9 @@ function AuxFilter.init(env)
2024

2125
-- 設定預設觸發鍵為分號,並從配置中讀取自訂的觸發鍵
2226
env.trigger_key = config:get_string("axu_code/trigger_word") or ";"
27+
-- 对内容进行替换
28+
env.trigger_key = alt_lua_punc( env.trigger_key )
29+
2330
-- 设定是否显示辅助码,默认为显示
2431
env.show_aux_notice = config:get_string("axu_code/show_aux_notice") or 'always'
2532

0 commit comments

Comments
 (0)