fix(config): check correct var for single config result. Fixes #167

This commit is contained in:
Folke Lemaitre 2024-11-27 23:56:54 +01:00
parent b2c13e5c89
commit 45fd0efe41
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -11,6 +11,7 @@
---@field notify snacks.notify
---@field quickfile snacks.quickfile
---@field health snacks.health
---@field profiler snacks.profiler
---@field rename snacks.rename
---@field statuscolumn snacks.statuscolumn
---@field terminal snacks.terminal
@ -96,7 +97,7 @@ function M.config.get(snack, defaults, ...)
table.insert(merge, vim.deepcopy(v))
end
end
local ret = #todo == 1 and todo[1] or vim.tbl_deep_extend("force", unpack(merge)) --[[@as snacks.Config.base]]
local ret = #merge == 1 and merge[1] or vim.tbl_deep_extend("force", unpack(merge)) --[[@as snacks.Config.base]]
if type(ret.config) == "function" then
ret.config(ret, defaults)
end