From f45301032f2a36112f3719484fd8f21f12787f5c Mon Sep 17 00:00:00 2001 From: pynappo Date: Wed, 7 Feb 2024 17:55:56 -0800 Subject: [PATCH] Add extra normalization check This extra check will more optimistically try to normalize a spec formatted like this: ```lua return { {'foo/bar'}, baz = "asdf" } ``` Before, lazy.nvim would see that it's a table with a length of 1 and that it's not a list, so it tries to add the table containing the spec directly, instead of the spec itself. This check makes lazy.nvim proceed to normalize {'foo/bar'} instead. --- lua/lazy/core/plugin.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index 8bcb10b..cac742b 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -353,7 +353,7 @@ function Spec:normalize(spec, results) else self:add({ spec }, results) end - elseif #spec > 1 or Util.is_list(spec) then + elseif #spec > 1 or Util.is_list(spec) or type(spec[1]) == "table" then ---@cast spec LazySpec[] local ignored_keys_exist = false for k, s in pairs(spec) do