mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
feat(picker): opts.on_close
This commit is contained in:
parent
b773368f8a
commit
6235f44b11
2 changed files with 5 additions and 0 deletions
|
@ -99,6 +99,7 @@ local M = {}
|
|||
---@field main? snacks.picker.main.Config main editor window config
|
||||
---@field on_change? fun(picker:snacks.Picker, item?:snacks.picker.Item) called when the cursor changes
|
||||
---@field on_show? fun(picker:snacks.Picker) called when the picker is shown
|
||||
---@field on_close? fun(picker:snacks.Picker) called when the picker is closed
|
||||
---@field jump? snacks.picker.jump.Config|{}
|
||||
--- Other
|
||||
---@field config? fun(opts:snacks.picker.Config):snacks.picker.Config? custom config function
|
||||
|
|
|
@ -590,6 +590,10 @@ function M:close()
|
|||
return
|
||||
end
|
||||
|
||||
if self.opts.on_close then
|
||||
self.opts.on_close(self)
|
||||
end
|
||||
|
||||
self:hist_record(true)
|
||||
self.closed = true
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue