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:
@@ -30,6 +30,10 @@ function M.start()
|
||||
vim.api.nvim_create_autocmd("VimLeavePre", {
|
||||
group = vim.api.nvim_create_augroup("persistence", { clear = true }),
|
||||
callback = function()
|
||||
if Config.options.pre_save then
|
||||
Config.options.pre_save()
|
||||
end
|
||||
|
||||
M.save()
|
||||
end,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user