hchunhui / librime-lua

Extending RIME with Lua scripts
BSD 3-Clause "New" or "Revised" License
309 stars 43 forks source link

add options and properties #357

Open shewer opened 3 months ago

shewer commented 3 months ago

新增訪問 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]) 
hchunhui commented 1 month ago

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

shewer commented 1 month ago

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