mirror of
https://github.com/folke/snacks.nvim
synced 2025-07-15 17:15:13 +00:00
23 lines
540 B
Lua
23 lines
540 B
Lua
local M = {}
|
|
|
|
---@param opts snacks.picker.notifications.Config
|
|
function M.notifier(opts)
|
|
local notifs = Snacks.notifier.get_history({ filter = opts.filter, reverse = true })
|
|
local items = {} ---@type snacks.picker.finder.Item[]
|
|
|
|
for _, notif in ipairs(notifs) do
|
|
items[#items + 1] = {
|
|
text = Snacks.picker.util.text(notif, { "level", "title", "msg" }),
|
|
item = notif,
|
|
severity = notif.level,
|
|
preview = {
|
|
text = notif.msg,
|
|
ft = "markdown",
|
|
},
|
|
}
|
|
end
|
|
|
|
return items
|
|
end
|
|
|
|
return M
|