Skip to content

Commit

Permalink
fix(plugin): rebuild optional when needed and remove frags from paren…
Browse files Browse the repository at this point in the history
…t deps. Fixes #1402
  • Loading branch information
folke committed Jun 16, 2024
1 parent 38d6b74 commit b4316da
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lua/lazy/core/plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b4316da

Please sign in to comment.