From f7de229fe774f9b56fd86e1805416ce1a5b5a4ca Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 22 Aug 2021 23:47:38 -0400 Subject: [PATCH] Default :Git grep to pager, not quickfix And bring back the column default when we do use the quickfix, why not? --- autoload/fugitive.vim | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index fb8482b..12d96f9 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -5317,13 +5317,18 @@ function! s:GrepSubcommand(line1, line2, range, bang, mods, options) abort endif let i += 1 endwhile - if !handle + if handle < 0 ? !quiet : !handle return {} endif let listnr = a:line1 == 0 ? a:line1 : a:line2 - let cmd = ['grep', '-n', '--no-color', '--full-name'] + if s:HasOpt(args, '--no-line-number') + let lc = [] + else + let lc = fugitive#GitVersion(2, 19) ? ['-n', '--column'] : ['-n'] + endif + let cmd = ['grep', '--no-color', '--full-name'] + lc let dir = s:Dir(a:options) - let options = s:GrepOptions(['-n'] + args, dir) + let options = s:GrepOptions(lc + args, dir) if listnr > 0 exe listnr 'wincmd w' else @@ -5384,7 +5389,7 @@ endfunction function! fugitive#GrepCommand(line1, line2, range, bang, mods, arg) abort return fugitive#Command(a:line1, a:line2, a:range, a:bang, a:mods, - \ "-c grep.column grep -O " . a:arg) + \ "grep -O " . a:arg) endfunction let s:log_diff_context = '{"filename": fugitive#Find(v:val . from, a:dir), "lnum": get(offsets, v:key), "module": strpart(v:val, 0, len(a:state.base_module)) . from}'