fix(notifier): re-apply winhl since level might have changed with a replace

This commit is contained in:
Folke Lemaitre 2024-11-08 09:28:13 +01:00
parent 5fd9c426e8
commit b8cc93e273
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -436,21 +436,19 @@ function N:render(notif)
backdrop = false,
ft = notif.ft,
noautocmd = true,
wo = {
winhighlight = table.concat({
"Normal:" .. notif_hl.msg,
"NormalNC:" .. notif_hl.msg,
"FloatBorder:" .. notif_hl.border,
"FloatTitle:" .. notif_hl.title,
"FloatFooter:" .. notif_hl.footer,
}, ","),
},
keys = {
q = function()
self:hide(notif.id)
end,
},
})
win.opts.wo.winhighlight = table.concat({
"Normal:" .. notif_hl.msg,
"NormalNC:" .. notif_hl.msg,
"FloatBorder:" .. notif_hl.border,
"FloatTitle:" .. notif_hl.title,
"FloatFooter:" .. notif_hl.footer,
}, ",")
notif.win = win
---@diagnostic disable-next-line: invisible
local buf = win:open_buf()
@ -578,7 +576,6 @@ function N:layout()
notif.win.opts.col = vim.o.columns - notif.layout.width - self.opts.margin.right
notif.shown = notif.shown or ts()
notif.win:show()
notif.win:update()
end
end
end