mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
feat(picker.layout): added config hook for resolved layouts. See #2035
This commit is contained in:
parent
ba7845bb85
commit
722f9eac7c
2 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -262,6 +262,10 @@ function M.layout(opts)
|
|||
end
|
||||
end
|
||||
|
||||
if layout.config then
|
||||
layout = layout.config(layout) or layout
|
||||
end
|
||||
|
||||
return layout
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue