From d116118addd7444e7bd1b65a50de2d25bec32d28 Mon Sep 17 00:00:00 2001 From: MeanderingProgrammer Date: Wed, 9 Jul 2025 15:39:16 -0700 Subject: 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. --- lua/nvim-treesitter/install.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lua') 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 ---@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) -- cgit v1.2.3-70-g09d2