From c3132492714661121f70daf77d716053ab39bd0b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 7 Jan 2023 09:37:03 +0100 Subject: [PATCH] feat(spec): show error when loading two specs with the same name and a different url. Fixes #337 --- lua/lazy/core/plugin.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index e9af209..fe3a34b 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -250,6 +250,10 @@ end function Spec:merge(old, new) new._.dep = old._.dep and new._.dep + if new.url and old.url and new.url ~= old.url then + self:error("Two plugins with the same name and different url:\n" .. vim.inspect({ old = old, new = new })) + end + for _, prop in ipairs(list_merge) do if new[prop] and old[prop] then ---@type any[]