Skip to content

Commit

Permalink
fix(plugin): delay check if plugin ref exists until after loading all…
Browse files Browse the repository at this point in the history
… plugins. Fixes #833
  • Loading branch information
folke committed May 27, 2023
1 parent 67ae8bb commit 199e100
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lua/lazy/core/plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ function Spec:add(plugin, results, is_dep)
plugin.dependencies = plugin.dependencies and self:normalize(plugin.dependencies, {}, true) or nil
if self.plugins[plugin.name] then
plugin = self:merge(self.plugins[plugin.name], plugin)
elseif is_ref and not plugin.url then
self:error("Plugin spec for **" .. plugin.name .. "** not found.\n```lua\n" .. vim.inspect(plugin) .. "\n```")
return
end
self.plugins[plugin.name] = plugin
if results then
Expand All @@ -150,6 +147,12 @@ function Spec:warn(msg)
end

function Spec:fix_disabled()
for _, plugin in pairs(self.plugins) do
if not plugin.url or not plugin.dir then
self:error("Plugin spec for **" .. plugin.name .. "** not found.\n```lua\n" .. vim.inspect(plugin) .. "\n```")
self.plugins[plugin.name] = nil
end
end
if not self.optional then
---@param plugin LazyPlugin
local function all_optional(plugin)
Expand Down

0 comments on commit 199e100

Please sign in to comment.