mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-03 18:28:38 +00:00
fix(picker): add alias for oldfiles
This commit is contained in:
parent
5b959320fc
commit
46554a6342
1 changed files with 3 additions and 2 deletions
|
@ -7,6 +7,7 @@ M.alias = {
|
|||
find_files = "files",
|
||||
git_commits = "git_log",
|
||||
git_bcommits = "git_log_file",
|
||||
oldfiles = "recent",
|
||||
}
|
||||
|
||||
---@param opts? snacks.picker.Config
|
||||
|
@ -18,14 +19,14 @@ function M.get(opts)
|
|||
local defaults = require("snacks.picker.config.defaults").defaults
|
||||
defaults.sources = sources
|
||||
local user = Snacks.config.picker or {}
|
||||
local source = M.alias[opts.source] or opts.source
|
||||
opts.source = M.alias[opts.source] or opts.source
|
||||
|
||||
local global = Snacks.config.get("picker", defaults, opts) -- defaults + global user config
|
||||
---@type snacks.picker.Config[]
|
||||
local todo = {
|
||||
defaults,
|
||||
user,
|
||||
source and global.sources[source] or {},
|
||||
opts.source and global.sources[opts.source] or {},
|
||||
opts,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue