Closed chrisgrieser closed 2 hours ago
Good idea. Added!
wow, thanks for the quick implementation.
Brief follow-up: I just noticed, it should definitely also support timeout = false
. Because right now, timeout = false
does work for nvim-notify but not snacks, while timeout = 0
works for snacks, but not nvim-notify.
Added as well.
And for completeness timeout = true for the default timeout...
Did you check the docs?
Is your feature request related to a problem? Please describe.
One common scenario is wanting to keep a notification on screen until manually dismissed via
require("snacks").notifier.hide()
. An ergonomic and intuitive way for doing so would be to havetimeout = 0
(ortimeout = false
) effectively disable the timeout.This would make
snacks.nvim
also more backwards-compatible withnvim-notify
, which also usestimeout = false
to keep a notification on screen.Describe the solution you'd like
vim.notify("foobar", vim.log.levels.INFO, { timeout = 0 })
should keep the notification on screen, andtimeout = false
would do the same.Describe alternatives you've considered
Using
keep = function() return true end
.Additional context
As far as I can tell,
timeout = 0
to keep something on screen is a common practice when designing APIs. Obsidian notifications, for instance, also work like that.