Skip to content

Commit

Permalink
fix(spec): don't import specs more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 10, 2023
1 parent 9fa62ea commit ad7aafb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/lazy/core/plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ function Spec:import(spec)
if spec.import == "lazy" then
return self:error("You can't name your plugins module `lazy`.")
end
if vim.tbl_contains(self.modules, spec.import) then
return
end
if spec.enabled == false or (type(spec.enabled) == "function" and not spec.enabled()) then
return
end
Expand Down Expand Up @@ -278,6 +281,7 @@ function Spec:merge(old, new)
end
new._.super = old
setmetatable(new, { __index = old })

return new
end

Expand Down

0 comments on commit ad7aafb

Please sign in to comment.