mirror of https://github.com/folke/lazy.nvim.git
refactor(plugin): refactored rebuild
This commit is contained in:
parent
d8453bc137
commit
82da5a0048
|
@ -172,8 +172,14 @@ function Spec:warn(msg)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Rebuilds a plugin spec excluding any removed fragments
|
--- Rebuilds a plugin spec excluding any removed fragments
|
||||||
---@param name string
|
---@param name? string
|
||||||
function Spec:rebuild(name)
|
function Spec:rebuild(name)
|
||||||
|
if not name then
|
||||||
|
for n, _ in pairs(self.dirty) do
|
||||||
|
self:rebuild(n)
|
||||||
|
end
|
||||||
|
self.dirty = {}
|
||||||
|
end
|
||||||
local plugin = self.plugins[name]
|
local plugin = self.plugins[name]
|
||||||
if not plugin then
|
if not plugin then
|
||||||
return
|
return
|
||||||
|
@ -292,11 +298,11 @@ function Spec:fix_disabled()
|
||||||
end
|
end
|
||||||
|
|
||||||
self:fix_optional()
|
self:fix_optional()
|
||||||
-- rebuild any plugin specs that were modified
|
self:rebuild()
|
||||||
for name, _ in pairs(self.dirty) do
|
|
||||||
self:rebuild(name)
|
|
||||||
end
|
|
||||||
self:fix_cond()
|
self:fix_cond()
|
||||||
|
self:rebuild()
|
||||||
|
|
||||||
self.dirty = {}
|
self.dirty = {}
|
||||||
|
|
||||||
for _, plugin in pairs(self.plugins) do
|
for _, plugin in pairs(self.plugins) do
|
||||||
|
@ -311,9 +317,7 @@ function Spec:fix_disabled()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- rebuild any plugin specs that were modified
|
-- rebuild any plugin specs that were modified
|
||||||
for name, _ in pairs(self.dirty) do
|
self:rebuild()
|
||||||
self:rebuild(name)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param msg string
|
---@param msg string
|
||||||
|
|
Loading…
Reference in New Issue