Skip to content

Commit

Permalink
fix(highlights): always try to attach highlights when triggered (#1025)
Browse files Browse the repository at this point in the history
fixes #1024
  • Loading branch information
champignoom committed Aug 14, 2023
1 parent 66e5a4e commit 31b3bfd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lua/neorg/modules/core/highlights/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,12 @@ end
module.load = function()
module.required["core.autocommands"].enable_autocommand("BufEnter")
module.required["core.autocommands"].enable_autocommand("FileType")
module.required["core.autocommands"].enable_autocommand("ColorScheme", true)
module.public.trigger_highlights()
vim.api.nvim_create_autocmd("ColorScheme", {
vim.api.nvim_create_autocmd({"FileType", "ColorScheme"}, {
callback = module.public.trigger_highlights,
})
end
Expand All @@ -439,10 +440,10 @@ module.public = {
"nvim-treesitter has no available highlights for norg! Ensure treesitter is properly loaded in your config."
)
end
end
if vim.bo.filetype == "norg" then
require("nvim-treesitter.highlight").attach(vim.api.nvim_get_current_buf(), "norg")
end
if vim.bo.filetype == "norg" then
require("nvim-treesitter.highlight").attach(vim.api.nvim_get_current_buf(), "norg")
end
end
Expand Down

0 comments on commit 31b3bfd

Please sign in to comment.