Skip to content

Commit

Permalink
fix(ToC): only try to open when still in norg buffer (nvim-neorg#1549)
Browse files Browse the repository at this point in the history
  • Loading branch information
benlubas authored Aug 8, 2024
1 parent f0990be commit 88dbab5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 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,10 @@ module.load = function()
pattern = "*.norg",
callback = function()
vim.schedule(function()
next_open_is_auto = true
vim.cmd([[Neorg toc]])
if vim.bo.filetype == "norg" then
next_open_is_auto = true
vim.cmd([[Neorg toc]])
end
end)
end,
})
Expand Down

0 comments on commit 88dbab5

Please sign in to comment.