feat(config): add pre-save LSP code actions and UI toggle helpers

This commit is contained in:
Prad Nukala committed 2026-08-25 14:47:06 -04:00
1 parent 20b7884c1e
commit f5106d9cba
3 files changed
+184

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
--- Shared snacks.picker helpers.
--- @module config.picker
local M = {}
--- Open a snacks picker with trouble.nvim's send-to-list action bound to <C-t>,
--- so a picker result set can be promoted to a persistent Trouble list.
--- @param source string snacks.picker source name (e.g. "diagnostics")
--- @param opts? snacks.picker.Config extra picker options
function M.with_trouble(source, opts)
opts = opts or {}
opts.actions = require("trouble.sources.snacks").actions
opts.win = opts.win or {}
opts.win.input = opts.win.input or {}
opts.win.input.keys = vim.tbl_extend("force", opts.win.input.keys or {}, {
["<c-t>"] = { "trouble_open", mode = { "n", "i" } },
})
require("snacks").picker[source](opts)
end
return M