feat(snacks.picker): use snacks picker for notifications when enabled

This commit is contained in:
Folke Lemaitre 2025-01-28 17:22:17 +01:00
parent 132986a624
commit 01a70cc60e
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 8 additions and 1 deletions

View file

@ -60,6 +60,7 @@ return {
{ "<leader>/", LazyVim.pick("grep"), desc = "Grep (Root Dir)" }, { "<leader>/", LazyVim.pick("grep"), desc = "Grep (Root Dir)" },
{ "<leader>:", function() Snacks.picker.command_history() end, desc = "Command History" }, { "<leader>:", function() Snacks.picker.command_history() end, desc = "Command History" },
{ "<leader><space>", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, { "<leader><space>", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
{ "<leader>n", function() Snacks.picker.notifications() end, desc = "Notification History" },
-- find -- find
{ "<leader>fb", function() Snacks.picker.buffers() end, desc = "Buffers" }, { "<leader>fb", function() Snacks.picker.buffers() end, desc = "Buffers" },
{ "<leader>fB", function() Snacks.picker.buffers({ hidden = true, nofile = true }) end, desc = "Buffers (all)" }, { "<leader>fB", function() Snacks.picker.buffers({ hidden = true, nofile = true }) end, desc = "Buffers (all)" },

View file

@ -278,7 +278,13 @@ return {
}, },
-- stylua: ignore -- stylua: ignore
keys = { keys = {
{ "<leader>n", function() Snacks.notifier.show_history() end, desc = "Notification History" }, { "<leader>n", function()
if Snacks.config.picker and Snacks.config.picker.enabled then
Snacks.picker.notifications()
else
Snacks.notifier.show_history()
end
end, desc = "Notification History" },
{ "<leader>un", function() Snacks.notifier.hide() end, desc = "Dismiss All Notifications" }, { "<leader>un", function() Snacks.notifier.hide() end, desc = "Dismiss All Notifications" },
}, },
}, },