mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-05 19:28:24 +00:00
feat(picker.multi): multi now also merges keymaps
This commit is contained in:
parent
859af8a255
commit
8b2c78a3bf
2 changed files with 9 additions and 9 deletions
|
@ -113,6 +113,15 @@ function M.multi(opts)
|
||||||
previews[#previews + 1] = M.preview(source)
|
previews[#previews + 1] = M.preview(source)
|
||||||
formats[#formats + 1] = M.format(source)
|
formats[#formats + 1] = M.format(source)
|
||||||
sources[#sources + 1] = source
|
sources[#sources + 1] = source
|
||||||
|
|
||||||
|
-- merge keys
|
||||||
|
for w, win in pairs(source.win or {}) do
|
||||||
|
if win.keys then
|
||||||
|
opts.win = opts.win or {}
|
||||||
|
opts.win[w] = opts.win[w] or {}
|
||||||
|
opts.win[w].keys = Snacks.config.merge(opts.win[w].keys or {}, win.keys)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.finder = opts.finder or Finder.multi(finders)
|
opts.finder = opts.finder or Finder.multi(finders)
|
||||||
|
|
|
@ -566,15 +566,6 @@ M.smart = {
|
||||||
frecency = true, -- use frecency boosting
|
frecency = true, -- use frecency boosting
|
||||||
sort_empty = true, -- sort even when the filter is empty
|
sort_empty = true, -- sort even when the filter is empty
|
||||||
},
|
},
|
||||||
win = {
|
|
||||||
input = {
|
|
||||||
keys = {
|
|
||||||
["dd"] = "bufdelete",
|
|
||||||
["<c-x>"] = { "bufdelete", mode = { "n", "i" } },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
list = { keys = { ["dd"] = "bufdelete" } },
|
|
||||||
},
|
|
||||||
transform = "unique_file",
|
transform = "unique_file",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue