feat(picker.smart): re-implemented smart as multi-source picker

This commit is contained in:
Folke Lemaitre 2025-01-22 23:49:02 +01:00
parent 9434986ff1
commit 450d1d4d4c
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -559,11 +559,13 @@ M.search_history = {
---@field finders? string[] list of finders to use
---@field filter? snacks.picker.filter.Config
M.smart = {
finder = "smart",
finders = { "buffers", "recent", "files" },
format = "file",
-- sort the results even when the filter is empty (frecency)
matcher = { sort_empty = true },
multi = { "buffers", "recent", "files" },
format = "file", -- use `file` format for all sources
matcher = {
cwd_bonus = true, -- boost cwd matches
frecency = true, -- use frecency boosting
sort_empty = true, -- sort even when the filter is empty
},
win = {
input = {
keys = {
@ -573,6 +575,7 @@ M.smart = {
},
list = { keys = { ["dd"] = "bufdelete" } },
},
transform = "unique_file",
}
M.spelling = {