mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
feat(picker): added args
option for files
and grep
. Closes #621
This commit is contained in:
parent
c258a6ef87
commit
781b6f6ab0
3 changed files with 8 additions and 0 deletions
|
@ -119,6 +119,7 @@ M.diagnostics_buffer = {
|
|||
---@field dirs? string[] directories to search
|
||||
---@field follow? boolean follow symlinks
|
||||
---@field exclude? string[] exclude patterns
|
||||
---@field args? string[] additional arguments
|
||||
M.files = {
|
||||
finder = "files",
|
||||
format = "file",
|
||||
|
@ -218,6 +219,7 @@ M.git_diff = {
|
|||
---@field buffers? boolean search in open buffers
|
||||
---@field need_search? boolean require a search pattern
|
||||
---@field exclude? string[] exclude patterns
|
||||
---@field args? string[] additional arguments
|
||||
M.grep = {
|
||||
finder = "grep",
|
||||
format = "file",
|
||||
|
|
|
@ -60,6 +60,9 @@ local function get_cmd(opts, filter)
|
|||
args[#args + 1] = "-L"
|
||||
end
|
||||
|
||||
-- extra args
|
||||
vim.list_extend(args, opts.args or {})
|
||||
|
||||
-- file glob
|
||||
---@type string?
|
||||
local pattern, pargs = Snacks.picker.util.parse(filter.search)
|
||||
|
|
|
@ -66,6 +66,9 @@ local function get_cmd(opts, filter)
|
|||
args[#args + 1] = g
|
||||
end
|
||||
|
||||
-- extra args
|
||||
vim.list_extend(args, opts.args or {})
|
||||
|
||||
args[#args + 1] = "--"
|
||||
|
||||
-- search pattern
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue