fix(event): make sure to create object during on tab enter (#65)

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
Aaron Pham 2024-08-18 06:06:17 -04:00 committed by GitHub
parent 1f1aed36bd
commit 8e503ef114
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,6 +74,18 @@ H.autocmds = function()
})
end
api.nvim_create_autocmd("TabEnter", {
pattern = "*",
once = true,
callback = function(ev)
local tab = tonumber(ev.file)
M._init(tab or api.nvim_get_current_tabpage())
if not M.current.selection.did_setup then
M.current.selection:setup_autocmds()
end
end,
})
api.nvim_create_autocmd("TabClosed", {
pattern = "*",
callback = function(ev)