mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 23:03:51 -05:00
Favor :Ggrep over :Git grep
I'm starting to think :Git grep shouldn't be special cased. Occasionally it is desirable to see grep results without clobbering the quickfix list. Reserve -O/--open-files-in-pager to opt into quickfix behavior, as this fits well with Fugitive's use of a temp buffer as the Git pager.
This commit is contained in:
@@ -4136,6 +4136,9 @@ function! s:GrepSubcommand(line1, line2, range, bang, mods, options) abort
|
||||
endif
|
||||
let tree = s:Tree(dir)
|
||||
let args = a:options.args
|
||||
if get(args, 0, '') =~# '^-O\|--open-files-in-pager$'
|
||||
let args = args[1:-1]
|
||||
endif
|
||||
let name_only = s:HasOpt(args, '-l', '--files-with-matches', '--name-only', '-L', '--files-without-match')
|
||||
let title = [listnr < 0 ? ':Ggrep' : ':Glgrep'] + args
|
||||
if listnr > 0
|
||||
|
||||
Reference in New Issue
Block a user