Results 215 comments of Shewer Lu

> 这样感觉不行,丢失了“是否被修改”这个信息。完全可以存在 projection 到自身的情况。 由代码可以看出输入不允许为空串,所以原来在失败时返回空串反而是更合理的。 > > https://github.com/rime/librime/blob/99e269c8eb251deddbad9b0d2c4d965b228f8006/src/rime/algo/algebra.cc#L101 string apply(T &t, string s ); lua_api 只收 string , nil 會產生 runtime error 所以在lua 環境下只能有 type error or modified 排除 runtime...

不建議 除非 是必要且共用的library 且只能載入到 global 且 固定變數名 ```lua -- 在 shared_data/lua , user_data/lua 增加 conf_dir 將 lua file 放在路逕下 local function load_conf( data_dir ) local lib_path= "conf_dir" -- lua/config_dir local...

rime_api 本身就是 table 可以在 rime_api 內增加 conf_files() 但是 lua.conf.d 不在 package.path 無法使用 require ```lua -- rime_api.lua function rime_api.conf_files() local ch = package.config:sub(1,1) -- uinx =/ win = \ local cmd...

> history 可以完全用 lua 实现,不需要再绑定 C++ 的接口了 [#23 (comment)](https://github.com/hchunhui/librime-lua/issues/23#issuecomment-609849993) 雖然不是強需求,但是可以調出,history 如: commit_text 是取不到的,但是 有將 commit_text push 到 history https://github.com/rime/librime/blob/f7a456937802d063a781baf37c8698cd6d6b305e/src/rime/engine.cc#L229 librime 目前取不 到非lua_component commit_text 資料

> 在什么地方可以找到lua的小狼毫扩展的帮助文档,最好好似有一些接口与对象的属性及用法的。 > 如 > > ``` > local function translator(input, seg, env) > end > ``` > > 上面的input、seg、env对象有哪些属性,函数,如何使用等等的帮助说明 librime/src/rime/engine.c hh [ processor](https://github.com/rime/librime/blob/4e518b96a381c5ee2e82d43247d9f49886af8b75/src/rime/engine.cc#L98) [segmentor]( https://github.com/rime/librime/blob/4e518b96a381c5ee2e82d43247d9f49886af8b75/src/rime/engine.cc#L162) [translator filter](https://github.com/rime/librime/blob/4e518b96a381c5ee2e82d43247d9f49886af8b75/src/rime/engine.cc#L191) 流程 common.h...

我試過 如果 打上 lua_processor@xxx@xx name_spce 會等於最後一個 lua_component init時 檢查 全域 xxx == nil 再LOADFILE 或是 用 config:getstring( "xx/luafile") 取得 userdata/lua/

目前 librime-lua 已有 method https://github.com/hchunhui/librime-lua/blob/15bd231e46fb5c0c7dd8a81d2d30fee9a838f0fa/src/types.cc#L403-L418 https://github.com/hchunhui/librime-lua/blob/15bd231e46fb5c0c7dd8a81d2d30fee9a838f0fa/src/types.cc#L588-L600 ```lua local schema= Schema("cangjie5") env.engine:apply_schema(schema) ``` lua component 是在方案下 你可以試試,只是 方案和方案`之間 都要有 lua component 才有用 , 不然跑過去就回不來了, 這也增加 方案與方案間整合的複雜度 覺得 實現這功能 花費時間 -- 使用度...

查 LOG 好奇問一下 切換方案的目的爲何?? 切換時機 熱鍵不好用? 能不能 把 方案 合拼 再用 script 切換 tag

local s=Schema( "cangjie5") -- schema_id create instance of schema env.engine:apply_schema( s ) 注意 因爲 engine會重導入 engine/.... 下的 component。 可能會因爲 下一個 方案 沒有 lua_componet 跳不回來唷 前面的 lua_component 會 call fini 清理...

我測試 OK 可能 檢查一下有沒有 build/cangjie5.schema.yaml 還是 你的 librime-lua version 是舊的 沒有 engine:apply_schema ``lua local function processor_func(,,,,,,,) if key:repr() == "F10" then local s= Schema("cangjie5") env.engine:apply_schema(s) return Accepted end end ```...