mirror of https://github.com/folke/lazy.nvim.git
fix(spec): don't import specs more than once
This commit is contained in:
parent
9fa62ea8ea
commit
ad7aafb257
|
@ -225,6 +225,9 @@ function Spec:import(spec)
|
||||||
if spec.import == "lazy" then
|
if spec.import == "lazy" then
|
||||||
return self:error("You can't name your plugins module `lazy`.")
|
return self:error("You can't name your plugins module `lazy`.")
|
||||||
end
|
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
|
if spec.enabled == false or (type(spec.enabled) == "function" and not spec.enabled()) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -278,6 +281,7 @@ function Spec:merge(old, new)
|
||||||
end
|
end
|
||||||
new._.super = old
|
new._.super = old
|
||||||
setmetatable(new, { __index = old })
|
setmetatable(new, { __index = old })
|
||||||
|
|
||||||
return new
|
return new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue