end
})
--- [vsplit]: update state if pane is being closed
-vim.api.nvim_create_autocmd( "WinClosed", {
- desc = "update vsplit state if pane is being closed",
- group = group_vsplit,
- callback = function()
- local vsplit = require("snippets.vsplit")
- vsplit.check_and_close{ win_id = vim.api.nvim_get_current_win() }
- end
-})
-
-- remove trailing whitespace on save
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
pattern = { "*" },
end
end
--- update state if pane is being closed
-M.check_and_close = function(opts)
- opts = opts or {}
-
- if (opts.win_id == M.left_id) then
- M.left_id = nil
- elseif (opts.win_id == M.right_id) then
- M.right_id = nil
- end
-end
-
return M