diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2020-05-01 10:30:25 +0200 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2020-05-01 12:16:00 +0200 |
| commit | 0b4cdba3e49d77d5914af38e29c46229d9cd059a (patch) | |
| tree | 9c75ab4f7941706483b9137cf31c02853bd06d22 /lua | |
| parent | fc88339832e61d7ed0c7604057cb02bb0ceec153 (diff) | |
Avoid global handle to enable installing multiple parsers in parallel
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 298a0e9f..77e0fccc 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -40,9 +40,11 @@ local function iter_cmd(cmd_list, i, ft) local attr = cmd_list[i] if attr.info then print(attr.info) end + local handle + handle = luv.spawn(attr.cmd, attr.opts, vim.schedule_wrap(function(code) 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) end)) end |
