fix(picker): load config for getting layout

This commit is contained in:
Folke Lemaitre 2025-01-13 23:26:06 +01:00
parent 15cd5901d9
commit 73fc653da9
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -30,7 +30,9 @@ end
--- Resolve the layout configuration
---@param opts snacks.picker.Config|string
function M.layout(opts)
opts = type(opts) == "string" and { layout = { preset = opts } } or opts
if type(opts) == "string" then
opts = M.get({ layout = { preset = opts } })
end
local layouts = require("snacks.picker.config.layouts")
local layout = M.resolve(opts.layout or {}, opts.source)
if layout.layout then