feat(picker.files): added ft option to filter by extension(s)

This commit is contained in:
Folke Lemaitre 2025-02-10 10:27:32 +01:00
parent d56cd48e4c
commit 12a7ea28b9
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
5 changed files with 25 additions and 2 deletions

View file

@ -49,8 +49,8 @@ Open the repo of the active file in the browser (e.g., GitHub)
end
vim.ui.open(url)
end,
---@type "repo" | "branch" | "file" | "commit"
what = "file", -- what to open. not all remotes support all types
---@type "repo" | "branch" | "file" | "commit" | "permalink"
what = "commit", -- what to open. not all remotes support all types
branch = nil, ---@type string?
line_start = nil, ---@type number?
line_end = nil, ---@type number?
@ -73,16 +73,19 @@ Open the repo of the active file in the browser (e.g., GitHub)
["github%.com"] = {
branch = "/tree/{branch}",
file = "/blob/{branch}/{file}#L{line_start}-L{line_end}",
permalink = "/blob/{commit}/{file}#L{line_start}-L{line_end}",
commit = "/commit/{commit}",
},
["gitlab%.com"] = {
branch = "/-/tree/{branch}",
file = "/-/blob/{branch}/{file}#L{line_start}-L{line_end}",
permalink = "/-/blob/{commit}/{file}#L{line_start}-L{line_end}",
commit = "/-/commit/{commit}",
},
["bitbucket%.org"] = {
branch = "/src/{branch}",
file = "/src/{branch}/{file}#lines-{line_start}-L{line_end}",
permalink = "/src/{commit}/{file}#lines-{line_start}-L{line_end}",
commit = "/commits/{commit}",
},
},

View file

@ -1221,6 +1221,7 @@ FILES *snacks-picker-sources-files*
---@field follow? boolean follow symlinks
---@field exclude? string[] exclude patterns
---@field args? string[] additional arguments
---@field ft? string|string[] file extension(s)
---@field rtp? boolean search in runtimepath
{
finder = "files",