diff --git a/lua/neorg/modules/core/qol/toc/module.lua b/lua/neorg/modules/core/qol/toc/module.lua index ca8fce675..b909be6c3 100644 --- a/lua/neorg/modules/core/qol/toc/module.lua +++ b/lua/neorg/modules/core/qol/toc/module.lua @@ -48,8 +48,12 @@ module.load = function() pattern = "*.norg", callback = function() vim.schedule(function() - next_open_is_auto = true - vim.cmd([[Neorg toc]]) + if + vim.api.nvim_get_option_value("filetype", { buf = vim.api.nvim_get_current_buf() }) == "norg" + then + next_open_is_auto = true + vim.cmd([[Neorg toc]]) + end end) end, })