Skip to content

Commit

Permalink
fix(toc): handle buf close
Browse files Browse the repository at this point in the history
  • Loading branch information
champignoom authored and vhyrro committed Dec 26, 2023
1 parent 2d65f6c commit 985364f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/neorg/modules/core/qol/toc/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,15 @@ module.on_event = function(event)
callback = close_buffer_callback,
})

vim.api.nvim_create_autocmd("WinClosed", {
pattern = "*",
callback = function(ev)
if ev.buf == ui_data.buffer then
close_buffer_callback()
end
end,
})

do
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*.norg",
Expand Down

0 comments on commit 985364f

Please sign in to comment.