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 committed Dec 21, 2023
1 parent 9c727b7 commit 811ffa0
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 811ffa0

Please sign in to comment.