Skip to content

Commit 313015f

Browse files
committed
feat(spec): allow mergig of config, priority and dependencies
1 parent 7d75598 commit 313015f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lua/lazy/core/plugin.lua

+9
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,16 @@ function Spec:merge(old, new)
165165
vim.list_extend(values, type(old[k]) == "string" and { old[k] } or old[k])
166166
---@diagnostic disable-next-line: no-unknown
167167
old[k] = values
168+
elseif k == "config" or k == "priority" then
169+
old[k] = v
170+
elseif k == "dependencies" then
171+
for _, dep in ipairs(v) do
172+
if not vim.tbl_contains(old[k], dep) then
173+
table.insert(old[k], dep)
174+
end
175+
end
168176
else
177+
old[k] = v
169178
self:error("Merging plugins is not supported for key `" .. k .. "`\n" .. vim.inspect({ old = old, new = new }))
170179
end
171180
else

0 commit comments

Comments
 (0)