feat(picker.layout): added config hook for resolved layouts. See #2035

This commit is contained in:
Folke Lemaitre 2025-10-11 11:08:55 +02:00
parent ba7845bb85
commit 722f9eac7c
No known key found for this signature in database
GPG key ID: 9B52594D560070AB
2 changed files with 5 additions and 0 deletions

View file

@ -56,6 +56,7 @@ local M = {}
---@field preset? string|fun(source:string):string
---@field hidden? ("input"|"preview"|"list")[] don't show the given windows when opening the picker. (only "input" and "preview" make sense)
---@field auto_hide? ("input"|"preview"|"list")[] hide the given windows when not focused (only "input" makes real sense)
---@field config? fun(layout:snacks.picker.layout.Config) customize the resolved layout config
---@class snacks.picker.win.Config
---@field input? snacks.win.Config|{} input window config

View file

@ -262,6 +262,10 @@ function M.layout(opts)
end
end
if layout.config then
layout = layout.config(layout) or layout
end
return layout
end