18 lines
570 B
Plaintext
18 lines
570 B
Plaintext
get_multiple_definitions_from_app = function(defs)
|
|
-- batch interface for speed
|
|
-- turn an array of string names into a table of string definitions corresponding to them
|
|
if #defs == 0 then return {} end
|
|
live.send_to_app('GET* '..table.concat(defs, ' '))
|
|
local response = wait_for_response()
|
|
local result = {}
|
|
for def in response:gmatch('(.-)\n==fw: definition boundary==\n') do
|
|
local name = live.get_definition_name_from_buffer(def)
|
|
if name == nil then
|
|
print('failed to get cmd from buffer', def)
|
|
else
|
|
result[name] = def
|
|
end
|
|
end
|
|
return result
|
|
end
|