librime-lua icon indicating copy to clipboard operation
librime-lua copied to clipboard

add options and properties

Open shewer opened this issue 1 year ago • 3 comments

新增訪問 options , properties api https://github.com/rime/librime/commit/a4f24fd705e78ccaf7d1fa65f36c31341ecab180

-- vars_get  & vars_set
context.options =  { a=true, b=true}
context.properties  = {a='a', b='b' }

local tab = context:get_options()  -- key: string value: bool
local tab = context:get_properties() -- key: string value: string

context:set_options(table [,force_write: bool])
context:set_properties(table [,force_write: bool]) 

shewer avatar Jul 04 '24 13:07 shewer

直接 wrap map & 较优。这样就不必中转 table

hchunhui avatar Aug 19 '24 12:08 hchunhui

試過在 lua_templte.h 加上 map , 但是失敗了

shewer avatar Aug 21 '24 08:08 shewer

直接 wrap map & 较优。这样就不必中转 table

己修正 lua_template.h 可以return table 了 移除 set_options set_properties

shewer avatar Jan 28 '25 04:01 shewer