trying stuff

main
Bryan 2024-11-11 06:27:20 -06:00
parent 12cdb6d705
commit e69c014833
1 changed files with 21 additions and 23 deletions

View File

@ -110,20 +110,19 @@ function M.stop()
M.fire("Stop") M.fire("Stop")
end end
-- vim.api.nvim_create_autocmd("SessionWritePost", { vim.api.nvim_create_autocmd("SessionWritePost", {
-- callback = function() callback = function()
-- if type(config.save_post) == "function" then if type(config.save_post) == "function" then
-- config.save_post() config.save_post()
-- end end
-- M.fire("SavePost") M.fire("SavePost")
-- -- return true -- returning true deletes autocmd after fired -- return true -- returning true deletes autocmd after fired
-- end, end,
-- }) })
---Save the session ---Save the session
---@param opts? { force?: boolean, session?: string } ---@param opts? { force?: boolean, session?: string }
function M.save(opts) function M.save(opts)
vim.schedule(function()
opts = opts or {} opts = opts or {}
-- Do not save the session if should_save evals to false...unless it's forced -- Do not save the session if should_save evals to false...unless it's forced
@ -138,7 +137,6 @@ function M.save(opts)
end end
pcall(vim.api.nvim_command, "wa") pcall(vim.api.nvim_command, "wa")
vim.api.nvim_command("mksession! " .. e(opts.session or vim.g.persisting_session or M.current())) vim.api.nvim_command("mksession! " .. e(opts.session or vim.g.persisting_session or M.current()))
end)
end end
---Delete the current session ---Delete the current session