fix pre/post load/save callbacks?
parent
28e72fb1ff
commit
d6485bc69f
|
|
@ -69,11 +69,11 @@ function M.load(opts)
|
|||
vim.g.persisted_loaded_session = session
|
||||
|
||||
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()
|
||||
end
|
||||
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()
|
||||
end
|
||||
M.fire("LoadPost")
|
||||
|
|
@ -117,11 +117,11 @@ function M.save(opts)
|
|||
end
|
||||
|
||||
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()
|
||||
end
|
||||
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()
|
||||
end
|
||||
M.fire("SavePost")
|
||||
|
|
|
|||
Loading…
Reference in New Issue