fix(plugin): rebuild optional when needed and remove frags from parent deps. Fixes #1402

This commit is contained in:
Folke Lemaitre 2024-06-16 15:52:21 +02:00
parent 38d6b74b63
commit b4316da731
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 10 additions and 2 deletions

View File

@ -232,6 +232,15 @@ function Spec:remove_fragments(id, opts)
else
local plugin = self.plugins[id]
repeat
if plugin._.fpid then
local parent = self.fragments[plugin._.fpid]
if parent then
parent._.fdeps = vim.tbl_filter(function(fid)
return fid ~= plugin._.fid
end, parent._.fdeps)
self.dirty[parent.name] = true
end
end
fids[#fids + 1] = plugin._.fid
plugin = plugin._.super
until not plugin
@ -318,11 +327,10 @@ function Spec:fix_disabled()
self.disabled[plugin.name] = plugin
end
end
self:rebuild()
-- check optional plugins again
self:fix_optional()
-- rebuild any plugin specs that were modified
self:rebuild()
end