Shewer Lu
Shewer Lu
會有~衝突 context.input --> utf-8 1 字串長度 2 context.input processors segmentors 都要用大部份都在處理 ascii code 3 translators 字典 code --> 詞彙 (utf8-> 詞彙)
改 promptt 容昜些 一大 一大大大| 一大大|k(大) 一大|kk(大大) 因爲 prompt 只要檢查右邊字串加入 prompt
不確定 要試才知道. 因爲用的少 一直沒搞懂 segmention segment menu context.caret_pos (set & get) 可以取得和設定 光標 和 context.input:sub( context.caret_pos) ```c++ // rime/gear/navigator.cc navigator 處理輸入欄內的光標移動 if (input_ != ctx->input() || ctx->caret_pos() ``` 在 SegmentReg...
https://github.com/hchunhui/librime-lua/blob/67ef681a9fd03262c49cc7f850cc92fc791b1e85/src/types.cc#L887 Projection ConfigList 是全域變數 也可以在 lua 中create config_list ```lua -- 從 yaml 中取得 preedit_format local config= env.engine.schema.config local config_list= config:get_list( "translator" .."/" .. "preedit_format") local projection= Projection() projection:load(config_list) local pstr=...
是的 我記得 trime 3.2.3 己有最新版本 有更新到 20210417 Projection Config Memory 有支援 librime-lua 作者在七月有 PR trime
IRime 不曾涉略
分享 code
可以自動轉換成 table ```lua local ks=KeySequence() ks:parse("abcdefg") print(ks,ks:toKeyEvent() ) for k,v in pairs(ks:toKeyEvent()) do print(k,v,v:repr()) end ``` 7LuaTypeISt10shared_ptrIN4rime11KeySequenceEEE: 0x557daecc2148 table: 0x557daecc2620 1 7LuaTypeIN4rime8KeyEventEE: 0x557daec678f8 a 2 7LuaTypeIN4rime8KeyEventEE: 0x557daec674e8 b 3 7LuaTypeIN4rime8KeyEventEE:...
應該是解決了 ,利用 inspect 了解情況 所有 Reg 都有 metatable 只要在 metatable 內 的 methods vars_get vars_set table 添加 function(self, ...) , 即可對 instance 增加 method ```lua local list= config:get_list( "engine/processors") local...
在 RimeApiReg 增加 一個 調用 comopent 的metatable 從測試狀況 KeySequence_mtname share_ptrKeySequence_mtname metatable 是相同 但是 addr 不同 真正增加 methods 只能在 share_ptrSequenece 下手 才有用 可以在 rime.lua 加入 lua script funclion 接口 ```c++ int...