diff options
| author | Sergey Kacheev <s.kacheev@gmail.com> | 2022-09-12 23:37:16 +0700 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2023-03-24 23:23:02 +0100 |
| commit | a072d923c7a18a5a326e80e31dc211f0ec679e54 (patch) | |
| tree | f63bcd8278a2dbd320e5abfac5581055c430b839 | |
| parent | fix: `get_range` shim for playground (diff) | |
| download | nvim-treesitter-a072d923c7a18a5a326e80e31dc211f0ec679e54.tar nvim-treesitter-a072d923c7a18a5a326e80e31dc211f0ec679e54.tar.gz nvim-treesitter-a072d923c7a18a5a326e80e31dc211f0ec679e54.tar.bz2 nvim-treesitter-a072d923c7a18a5a326e80e31dc211f0ec679e54.tar.lz nvim-treesitter-a072d923c7a18a5a326e80e31dc211f0ec679e54.tar.xz nvim-treesitter-a072d923c7a18a5a326e80e31dc211f0ec679e54.tar.zst nvim-treesitter-a072d923c7a18a5a326e80e31dc211f0ec679e54.zip | |
fix: uninstall function in the install.lua
The get_ensure_installed_parsers function return a table
for the option "all" because uninstall accepts a table
| -rw-r--r-- | lua/nvim-treesitter/configs.lua | 3 | ||||
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lua/nvim-treesitter/configs.lua b/lua/nvim-treesitter/configs.lua index 99fc6b840..a3ec30fb2 100644 --- a/lua/nvim-treesitter/configs.lua +++ b/lua/nvim-treesitter/configs.lua @@ -607,6 +607,9 @@ function M.get_ignored_parser_installs() end function M.get_ensure_installed_parsers() + if type(config.ensure_installed) == "string" then + return { config.ensure_installed } + end return config.ensure_installed or {} end diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 3ea23ee86..82d233e20 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -605,9 +605,7 @@ function M.uninstall(...) if vim.tbl_contains({ "all" }, ...) then reset_progress_counter() local installed = info.installed_parsers() - for _, langitem in pairs(installed) do - M.uninstall(langitem) - end + M.uninstall(installed) elseif ... then local ensure_installed_parsers = configs.get_ensure_installed_parsers() if ensure_installed_parsers == "all" then |
