Skip to content

Commit

Permalink
fix(ToC): only try to open when still in norg buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
benlubas committed Aug 5, 2024
1 parent 51c1134 commit b0ced4b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lua/neorg/modules/core/qol/toc/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down

0 comments on commit b0ced4b

Please sign in to comment.