Avoid line echo during jump to file in :Git -p grep

This commit is contained in:
Tim Pope
2021-08-19 17:03:53 -04:00
parent 01e843c21d
commit 771d1e3711

View File

@@ -5135,8 +5135,10 @@ function! fugitive#LogComplete(A, L, P) abort
return s:CompleteSub('log', a:A, a:L, a:P) return s:CompleteSub('log', a:A, a:L, a:P)
endfunction endfunction
function! s:GrepParseLine(options, dir, line) abort function! s:GrepParseLine(options, quiet, dir, line) abort
echo a:line if !a:quiet
echo a:line
endif
let entry = {'valid': 1} let entry = {'valid': 1}
let match = matchlist(a:line, '^\(.\{-\}\):\([1-9]\d*\):\([1-9]\d*:\)\=\(.*\)$') let match = matchlist(a:line, '^\(.\{-\}\):\([1-9]\d*\):\([1-9]\d*:\)\=\(.*\)$')
if len(match) if len(match)
@@ -5193,7 +5195,7 @@ endfunction
function! s:GrepCfile(result) abort function! s:GrepCfile(result) abort
let options = s:GrepOptions(a:result.args, a:result) let options = s:GrepOptions(a:result.args, a:result)
let entry = s:GrepParseLine(options, a:result, getline('.')) let entry = s:GrepParseLine(options, 1, a:result, getline('.'))
if get(entry, 'col') if get(entry, 'col')
return [entry.filename, entry.lnum, "norm!" . entry.col . "|"] return [entry.filename, entry.lnum, "norm!" . entry.col . "|"]
elseif has_key(entry, 'lnum') elseif has_key(entry, 'lnum')
@@ -5265,7 +5267,7 @@ function! s:GrepSubcommand(line1, line2, range, bang, mods, options) abort
let more = 1 let more = 1
set nomore set nomore
endif endif
call map(list, 's:GrepParseLine(options, dir, v:val)') call map(list, 's:GrepParseLine(options, 0, dir, v:val)')
call s:QuickfixSet(listnr, list, 'a') call s:QuickfixSet(listnr, list, 'a')
let press_enter_shortfall = &cmdheight - len(list) let press_enter_shortfall = &cmdheight - len(list)
if press_enter_shortfall > 0 if press_enter_shortfall > 0