mirror of
https://github.com/chenasraf/nvim-treesitter.git
synced 2026-05-17 17:38:02 +00:00
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.
This commit is contained in:
committed by
Christian Clason
parent
f14b356d54
commit
d116118add
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user