Skip to content

Commit

Permalink
fix(mux): Change on_exit to run on VimLeavePre instead of VimLeave
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Feb 27, 2024
1 parent e1e1e6c commit a714522
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/smart-splits/mux/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ end
---Initialization for mux capabilities.
---If selected mux has an `on_init` or `on_exit`,
---call `on_init` and set up autocmds to call `on_init` on `VimResume`
---and `on_exit` on `VimSuspend` and `VimLeave`.
---and `on_exit` on `VimSuspend` and `VimLeavePre`.
function M.startup()
local mux = require('smart-splits.mux').get()
if not mux then
Expand All @@ -38,7 +38,7 @@ function M.startup()
})
end
if mux.on_exit then
vim.api.nvim_create_autocmd({ 'VimSuspend', 'VimLeave' }, {
vim.api.nvim_create_autocmd({ 'VimSuspend', 'VimLeavePre' }, {
callback = function()
mux.on_exit()
end,
Expand Down

0 comments on commit a714522

Please sign in to comment.