feat(persistence): pre_save
option to call before saving (#22)
* feat(persistence): `pre_save` option to call before saving This commit adds the `pre_save` option, which is a `fun()|nil` that will be called (if present) before saving the current session. Use cases include filtering buffers, executing `User` autocmds, etc. * docs: `pre_save` option
This commit is contained in:
@ -71,6 +71,7 @@ Persistence comes with the following defaults:
|
||||
{
|
||||
dir = vim.fn.expand(vim.fn.stdpath("state") .. "/sessions/"), -- directory where session files are saved
|
||||
options = { "buffers", "curdir", "tabpages", "winsize" }, -- sessionoptions used for saving
|
||||
pre_save = nil, -- a function to call before saving the session
|
||||
}
|
||||
<
|
||||
|
||||
|
@ -71,6 +71,7 @@ Persistence comes with the following defaults:
|
||||
{
|
||||
dir = vim.fn.expand(vim.fn.stdpath("state") .. "/sessions/"), -- directory where session files are saved
|
||||
options = { "buffers", "curdir", "tabpages", "winsize" }, -- sessionoptions used for saving
|
||||
pre_save = nil, -- a function to call before saving the session
|
||||
}
|
||||
<
|
||||
|
||||
|
Reference in New Issue
Block a user