diff --git a/lua/neorg/modules/core/qol/toc/module.lua b/lua/neorg/modules/core/qol/toc/module.lua index c3c9377dc..617fe741d 100644 --- a/lua/neorg/modules/core/qol/toc/module.lua +++ b/lua/neorg/modules/core/qol/toc/module.lua @@ -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",