We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f1374dc commit 4a7cbc3Copy full SHA for 4a7cbc3
lua/resession/config.lua
@@ -82,7 +82,16 @@ M.setup = function(config)
82
autosave_timer:close()
83
autosave_timer = nil
84
end
85
+ local autosave_group = vim.api.nvim_create_augroup("ResessionAutosave", { clear = true })
86
if M.autosave.enabled then
87
+ vim.api.nvim_create_autocmd("VimLeavePre", {
88
+ group = autosave_group,
89
+ callback = function()
90
+ if resession.get_current() then
91
+ resession.save(nil, { notify = false })
92
+ end
93
+ end,
94
+ })
95
autosave_timer = vim.loop.new_timer()
96
timer = vim.loop.new_timer()
97
timer:start(
0 commit comments