Avoid global handle to enable installing multiple parsers in parallel

This commit is contained in:
Stephan Seitz 2020-05-01 10:30:25 +02:00
parent fc88339832
commit 0b4cdba3e4

View file

@ -40,6 +40,8 @@ local function iter_cmd(cmd_list, i, ft)
local attr = cmd_list[i] local attr = cmd_list[i]
if attr.info then print(attr.info) end if attr.info then print(attr.info) end
local handle
handle = luv.spawn(attr.cmd, attr.opts, vim.schedule_wrap(function(code) handle = luv.spawn(attr.cmd, attr.opts, vim.schedule_wrap(function(code)
handle:close() handle:close()
if code ~= 0 then return api.nvim_err_writeln(attr.err) end if code ~= 0 then return api.nvim_err_writeln(attr.err) end