mirror of https://github.com/folke/lazy.nvim.git
fix(plugin): rebuild optional when needed and remove frags from parent deps. Fixes #1402
This commit is contained in:
parent
38d6b74b63
commit
b4316da731
|
@ -232,6 +232,15 @@ function Spec:remove_fragments(id, opts)
|
||||||
else
|
else
|
||||||
local plugin = self.plugins[id]
|
local plugin = self.plugins[id]
|
||||||
repeat
|
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
|
fids[#fids + 1] = plugin._.fid
|
||||||
plugin = plugin._.super
|
plugin = plugin._.super
|
||||||
until not plugin
|
until not plugin
|
||||||
|
@ -318,11 +327,10 @@ function Spec:fix_disabled()
|
||||||
self.disabled[plugin.name] = plugin
|
self.disabled[plugin.name] = plugin
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
self:rebuild()
|
||||||
|
|
||||||
-- check optional plugins again
|
-- check optional plugins again
|
||||||
self:fix_optional()
|
self:fix_optional()
|
||||||
|
|
||||||
-- rebuild any plugin specs that were modified
|
|
||||||
self:rebuild()
|
self:rebuild()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue