diff options
| author | MeanderingProgrammer <meanderingprogrammer@gmail.com> | 2025-07-09 15:39:16 -0700 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2025-07-20 14:39:10 +0200 |
| commit | d116118addd7444e7bd1b65a50de2d25bec32d28 (patch) | |
| tree | 85d7fb0d9ec736ff5c12dd61f601eaa3afeaf220 | |
| parent | feat(chatito)!: update parser and queries (diff) | |
| download | nvim-treesitter-d116118addd7444e7bd1b65a50de2d25bec32d28.tar nvim-treesitter-d116118addd7444e7bd1b65a50de2d25bec32d28.tar.gz nvim-treesitter-d116118addd7444e7bd1b65a50de2d25bec32d28.tar.bz2 nvim-treesitter-d116118addd7444e7bd1b65a50de2d25bec32d28.tar.lz nvim-treesitter-d116118addd7444e7bd1b65a50de2d25bec32d28.tar.xz nvim-treesitter-d116118addd7444e7bd1b65a50de2d25bec32d28.tar.zst nvim-treesitter-d116118addd7444e7bd1b65a50de2d25bec32d28.zip | |
fix(install): don't make "installed" status persistent
Problem: Setting `install_status` to "installed" skips any future
install or update operation (even if forced). In particular, this breaks
`:TSUpdate` when calling `install()` in config files.
Solution: Don't set "installed" when skipping install and clear status
on successful operations.
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index c179600b6..233ea83fe 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -456,7 +456,6 @@ local install_status = {} ---@type table<string,InstallStatus?> ---@return InstallStatus status local function install_lang(lang, cache_dir, install_dir, force, generate) if not force and vim.list_contains(config.get_installed(), lang) then - install_status[lang] = 'installed' return 'installed' end @@ -475,6 +474,7 @@ local function install_lang(lang, cache_dir, install_dir, force, generate) local status = install_status[lang] assert(status and status ~= 'installing') + install_status[lang] = nil return status end @@ -570,7 +570,6 @@ end) ---@return string? err local function uninstall_lang(logger, lang, parser, queries) logger:debug('Uninstalling ' .. lang) - install_status[lang] = nil if fn.filereadable(parser) == 1 then logger:debug('Unlinking ' .. parser) |
