feat(spec): show error when loading two specs with the same name and a different url. Fixes #337

This commit is contained in:
Folke Lemaitre 2023-01-07 09:37:03 +01:00
parent 5ed89b5a0d
commit c313249271
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 4 additions and 0 deletions

View File

@ -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[]