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.
This commit is contained in:
pynappo 2024-02-07 17:55:56 -08:00
commit f45301032f
No known key found for this signature in database

View file

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