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 | Add `ensure_installed` option to config (diff) | |
| download | nvim-treesitter-0b4cdba3e49d77d5914af38e29c46229d9cd059a.tar nvim-treesitter-0b4cdba3e49d77d5914af38e29c46229d9cd059a.tar.gz nvim-treesitter-0b4cdba3e49d77d5914af38e29c46229d9cd059a.tar.bz2 nvim-treesitter-0b4cdba3e49d77d5914af38e29c46229d9cd059a.tar.lz nvim-treesitter-0b4cdba3e49d77d5914af38e29c46229d9cd059a.tar.xz nvim-treesitter-0b4cdba3e49d77d5914af38e29c46229d9cd059a.tar.zst nvim-treesitter-0b4cdba3e49d77d5914af38e29c46229d9cd059a.zip | |
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 298a0e9f7..77e0fccc4 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 |
