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:
parent
1f1aed36bd
commit
8e503ef114
@ -74,6 +74,18 @@ H.autocmds = function()
|
|||||||
})
|
})
|
||||||
end
|
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", {
|
api.nvim_create_autocmd("TabClosed", {
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
callback = function(ev)
|
callback = function(ev)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user