Shewer Lu
Shewer Lu
可以用 select_notifyer or commit_notifier(但要註冊在 engine 前) 上屏 有 Context::Commit() & Select() 在 processor: selector xxxx_editor 中實現 你可以 在這兩個前 加入入 lua_processor 檢查條件 直接使用 engine:commit_text(string) 但我覺的用 lua_filter 去修改 candidate 比較簡單 , 熱鍵...
你可以先查一下 wiki / script 說明 context.commit_notifier:connect( func[, group: size_t]) context.commit_notifirer:connect( func) -- 最後 context.commit_notifirer:connect( func, 1) -- 2 context.commit_notifirer:connect( func, 0) -- 1 還有 已經排入候選的candidate 是無法 替換的 ,所以在 engine call...
發送 select_notifier 是 selector 送出來的 發送 commit_notifier 是 editor_xxxx 送出來的 要欄下 要在這兩個processor 前加入 lua_processor 由你自己處理 可以看一下 librime source code https://github.com/rime/librime/blob/b74f5fa0b7377ba6103df7b6e757fbf84d36cf1f/src/rime/gear/selector.cc#L118
linux fcitx5 在 autosave & sync 時也一樣 E20240823 08:26:42.180635 139164842452672 level_db.cc:273] Error opening db '.temp' read-only. E20240823 08:26:42.180667 139164842452672 user_dict_manager.cc:204] error backing up user dict '.temp'. E20240823 08:26:42.180691 139164842452672 user_dict_manager.cc:220]...
我在 rime_api_console 中 使用 syncizhronize command 井不會出現這問題
找到問題了, 在user_data_dir 下有 .temp.userdb/ 目錄 GetUserDictLsit() 會在 user_data_dir 中查找 userdb 砍了就好了 可能是以前異常中斷時遺留下來的
把gc 做成 option 如何 vars_get vars_set 加入 enable_gc ```c++ LuaTranslation { public: bool enable_gc() :const { return enable_gc_;} void set_enable_gc(bool enable_gc) : enable_gc_(enable_gc) {}; private: bool enable_gc_ = true; }...
https://www.lua.org/manual/5.4/manual.html#lua_gc https://www.lua.org/manual/5.3/manual.html#lua_gc https://www.lua.org/manual/5.2/manual.html#lua_gc https://www.lua.org/manual/5.1/manual.html#lua_gc
> Question: does it work as expected after the fix? > > After `recognizer` handled the pattern `abzcd`, the new input`abz^cd` will probably not be given to `matcher` as `abzcd`...
一般正常輸入時 的確是 在 context.input 後面加上 字元,比較pattern 可是 當 caret_pos(^: caret_pos) 在 字串中間時 , active_input += ch 比較pattern 有點怪 abc^def 輸入z 應該 是 abcz^def 而不是 abc^defz