mirror of
https://github.com/folke/persistence.nvim.git
synced 2025-08-04 18:14:36 +02:00
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:
parent
d8a3eda0e1
commit
f4bb0c5641
5 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
<
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue