fix(notifier): show notifier errors with nvim_err_writeln

This commit is contained in:
Folke Lemaitre 2024-11-06 07:58:36 +01:00
parent 9ef9e69620
commit e8061bcda0
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -175,8 +175,14 @@ function M:start()
if #self.queue == 0 then
return
end
self:update()
self:layout()
local ok, err = pcall(function()
self:update()
self:layout()
end)
if not ok then
vim.api.nvim_err_writeln("Snacks notifier failed. Dropping queue. Error:\n " .. err)
self.queue = {}
end
end)
)
end