Skip to content

Commit

Permalink
feat(spec): allow mergig of config, priority and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 2, 2023
1 parent 7d75598 commit 313015f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/lazy/core/plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,16 @@ function Spec:merge(old, new)
vim.list_extend(values, type(old[k]) == "string" and { old[k] } or old[k])
---@diagnostic disable-next-line: no-unknown
old[k] = values
elseif k == "config" or k == "priority" then
old[k] = v
elseif k == "dependencies" then
for _, dep in ipairs(v) do
if not vim.tbl_contains(old[k], dep) then
table.insert(old[k], dep)
end
end
else
old[k] = v
self:error("Merging plugins is not supported for key `" .. k .. "`\n" .. vim.inspect({ old = old, new = new }))
end
else
Expand Down

0 comments on commit 313015f

Please sign in to comment.