mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 02:38:46 +00:00
feat(notifier): notification history
option (#297)
## Description <!-- Describe the big picture of your changes to communicate to the maintainers why we should accept this pull request. --> Option to exclude some notifications from notification history, for example, when dealing with spinners. ## Related Issue(s) <!-- If this PR fixes any issues, please link to the issue here. - Fixes #<issue_number> --> ## Screenshots <!-- Add screenshots of the changes if applicable. -->
This commit is contained in:
parent
7db0cc9281
commit
8f56e19f91
1 changed files with 4 additions and 1 deletions
|
@ -34,6 +34,7 @@ local uv = vim.uv or vim.loop
|
|||
---@field style? snacks.notifier.style
|
||||
---@field opts? fun(notif: snacks.notifier.Notif) -- dynamic opts
|
||||
---@field hl? snacks.notifier.hl -- highlight overrides
|
||||
---@field history? boolean
|
||||
|
||||
--- Notification object
|
||||
---@class snacks.notifier.Notif: snacks.notifier.Notif.opts
|
||||
|
@ -395,7 +396,9 @@ function N:add(opts)
|
|||
if numlevel(notif.level) >= numlevel(self.opts.level) then
|
||||
self.queue[notif.id] = notif
|
||||
end
|
||||
self.history[notif.id] = notif
|
||||
if opts.history ~= false then
|
||||
self.history[notif.id] = notif
|
||||
end
|
||||
if self:is_blocking() then
|
||||
pcall(function()
|
||||
self:process()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue