hchunhui / librime-lua

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

add new feature of Schema( "") to open default.yaml #334

Open shewer opened 2 months ago

shewer commented 2 months ago

Schema('') == Schema('.default')


-- 取得 default.yaml:/schema_list 所有 schema_id
local  schema= Schema('')
local size = schema.config:get_list('schema_list').size
local schemas_id={}
for i = 0, size-1 do 
   local path = ("schema_list/@%d/schema"):format(i)
   table.insert(schema_id ,  schema.config:get_string( path ) )
end
print(  table.concat(schemas_id, "\n") )
---