fix pre/post load/save callbacks?

main
Bryan 2024-11-07 00:50:50 -06:00
parent 28e72fb1ff
commit d6485bc69f
1 changed files with 4 additions and 4 deletions

View File

@ -69,11 +69,11 @@ function M.load(opts)
vim.g.persisted_loaded_session = session vim.g.persisted_loaded_session = session
M.fire("LoadPre") M.fire("LoadPre")
if config.load_pre and vim.is_callable(config.load_pre) then if type(config.load_pre) == "function" then
config.load_pre() config.load_pre()
end end
vim.cmd("silent! source " .. e(session)) vim.cmd("silent! source " .. e(session))
if config.load_post and vim.is_callable(config.load_post) then if type(config.load_post) == "function" then
config.load_post() config.load_post()
end end
M.fire("LoadPost") M.fire("LoadPost")
@ -117,11 +117,11 @@ function M.save(opts)
end end
M.fire("SavePre") M.fire("SavePre")
if config.save_pre and vim.is_callable(config.save_pre) then if type(config.save_pre) == "function" then
config.save_pre() config.save_pre()
end end
vim.cmd("mks! " .. e(opts.session or vim.g.persisting_session or M.current())) vim.cmd("mks! " .. e(opts.session or vim.g.persisting_session or M.current()))
if config.save_post and vim.is_callable(config.save_post) then if type(config.save_post) == "function" then
config.save_post() config.save_post()
end end
M.fire("SavePost") M.fire("SavePost")