fix: PersistedSavePre called when autosave = false

main
olimorris 2023-02-28 23:21:54 +00:00
parent 4cde12d8b9
commit 88f27dcab2
1 changed files with 8 additions and 8 deletions

View File

@ -136,14 +136,6 @@ function M.save(opt)
return return
end end
--TODO: Remove this after deprecation notice period ends
if type(config.options.before_save) == "function" then
config.options.before_save()
end
--
vim.api.nvim_exec_autocmds("User", { pattern = "PersistedSavePre" })
-- Autosave config option takes priority unless it's overriden -- Autosave config option takes priority unless it's overriden
if not config.options.autosave and not opt.override then if not config.options.autosave and not opt.override then
return return
@ -153,6 +145,14 @@ function M.save(opt)
return return
end end
--TODO: Remove this after deprecation notice period ends
if type(config.options.before_save) == "function" then
config.options.before_save()
end
--
vim.api.nvim_exec_autocmds("User", { pattern = "PersistedSavePre" })
vim.cmd("mks! " .. e(vim.g.persisting_session or get_current())) vim.cmd("mks! " .. e(vim.g.persisting_session or get_current()))
vim.g.persisting = true vim.g.persisting = true