feat(live_grep): add glob and type filter shorthand opts (#1695)

This commit is contained in:
kylo252
2022-05-04 21:57:29 +02:00
committed by GitHub
parent 8d1841bff5
commit 3f3cba430e
3 changed files with 15 additions and 0 deletions

View File

@@ -72,6 +72,14 @@ files.live_grep = function(opts)
additional_args = opts.additional_args(opts)
end
if opts.type_filter then
additional_args[#additional_args + 1] = "--type=" .. opts.type_filter
end
if opts.glob_pattern then
additional_args[#additional_args + 1] = "--glob=" .. opts.glob_pattern
end
local live_grepper = finders.new_job(function(prompt)
-- TODO: Probably could add some options for smart case and whatever else rg offers.