mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 18:30:06 -04:00
Avoid global handle to enable installing multiple parsers in parallel
This commit is contained in:
parent
fc88339832
commit
0b4cdba3e4
1 changed files with 3 additions and 1 deletions
|
|
@ -40,9 +40,11 @@ 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
|
||||||
iter_cmd(cmd_list, i + 1, ft)
|
iter_cmd(cmd_list, i + 1, ft)
|
||||||
end))
|
end))
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue