Shewer Lu
Shewer Lu
可以耶, 測試狀態,但是 大部份 candidate text 是改不了的, 除了 SimpleCandidate 在notifier func 中,加入 engine:commit_text( "--") 會 commit cand 後 commit -- ( 在commit_history 中會增加一個 record type: "raw" text: "--" 你可參考 librime rime/candidate.h...
你可以試試在https://github.com/hchunhui/librime-lua/blob/7f3eca2ce659fc2401b8acb52bd2182b433e12b1/src/types.cc#L1656 加入 memory.FinishSession();
一般从 table_translator (enable_completion: true 时) 产生的 candidate 可以从 cand.type =="completion" 来判断
> 小写的 `next()` 是为了实现 `iter()` 而做的内部函数,不应该再暴露来。 > > 另外原意是 lua 中只提供 `iter()` 就够用了。有点好奇 `exhausted()` `Peek()` `Next()` 这三者在什么情形下需要使用。 在多個 translation 排序時可以用Peek 檢查而不取出來
使用 Translation 實現 ```lua -- 從n個transltion 中取出當前cand.quility 最大值 的tran local function pickup_tran(...) local first_tran local trans = {...} for i,tran in next, trans do if not tran.exhausted then if not...
錄下 的key 參考 Alt_L Alt+space Alt+Release+space Alt+Release+Alt_L
你可以 搜一下 issue : commit_text ,查看歷史記錄 commit or commit_text 都是傳送 text 給前端, 沒有方法可以 只能試試 active app 是不能夠接受 多少 ascii 的控制碼 如terminal 可以用 ansi , xterm .... Component 下的物件 只是提供 lua_component...
因爲做不到, 這 個方案 只能 用 "\b" 着手 ``` if not context:is_composing() and key:repo() == "...." then comment_text("\b") return accepted end ``` a -> engine --> lua_processor() key = b --...
lua 中的 LevelDb 不支援 db_pool ( 可以多個翻譯器 同時參考己開啓的 userdb) MemoryReg 類似 翻譯器 ,可以同時 和其他翻譯器共用同一個userdb 如果 usredb 先被 LevelDb 開啓 將造成 Translator 無法開啓 userdb 檢查 方案中 lua script 是否有使用 LevelDb 開啓...
> 你好 @shewer ,如果在具体的 lua 中,比如: > > ```lua > local F = {} > > function F.init( env ) > local config = env.engine.schema.config > env.name_space = env.name_space:gsub( '^*',...