fix: PersistedSavePre called when autosave = false
parent
4cde12d8b9
commit
88f27dcab2
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue