From 313015fdb4b44a38f4b5c9fd045c5d29a65f7c7a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 2 Jan 2023 09:41:09 +0100 Subject: [PATCH] feat(spec): allow mergig of config, priority and dependencies --- lua/lazy/core/plugin.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index 5f01775..3c99b36 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -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