Skip to content

Commit

Permalink
refactor(concealer): use BufRead as the concealer trigger (was `Buf…
Browse files Browse the repository at this point in the history
…WinEnter`)
  • Loading branch information
vhyrro committed May 1, 2023
1 parent 3009adf commit ffabc4c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/neorg/modules/core/concealer/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ module.public = {
if module.private.enabled then
neorg.events.send_event(
"core.concealer",
neorg.events.create(module, "core.autocommands.events.bufwinenter", {
neorg.events.create(module, "core.autocommands.events.bufread", {
norg = true,
})
)
Expand Down Expand Up @@ -1377,7 +1377,7 @@ module.load = function()
module.private.icons = vim.tbl_values(get_enabled_icons(module.config.public.icons))

-- Enable the required autocommands (these will be used to determine when to update conceals in the buffer)
module.required["core.autocommands"].enable_autocommand("BufWinEnter")
module.required["core.autocommands"].enable_autocommand("BufRead")
module.required["core.autocommands"].enable_autocommand("InsertEnter")
module.required["core.autocommands"].enable_autocommand("InsertLeave")
module.required["core.autocommands"].enable_autocommand("VimLeavePre")
Expand Down Expand Up @@ -1439,7 +1439,7 @@ module.on_event = function(event)
or false
)

if event.type == "core.autocommands.events.bufwinenter" and event.content.norg then
if event.type == "core.autocommands.events.bufread" and event.content.norg then
if module.config.public.folds and vim.api.nvim_win_is_valid(event.window) then
local opts = {
scope = "local",
Expand Down Expand Up @@ -1678,7 +1678,7 @@ module.events.defined = {

module.events.subscribed = {
["core.autocommands"] = {
bufwinenter = true,
bufread = true,
insertenter = true,
insertleave = true,
vimleavepre = true,
Expand Down

0 comments on commit ffabc4c

Please sign in to comment.