From 771d1e37119c19b1ed3b170c1f68ee7d032414f0 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 19 Aug 2021 17:03:53 -0400 Subject: [PATCH] Avoid line echo during jump to file in :Git -p grep --- autoload/fugitive.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 627340c..cb9fba7 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -5135,8 +5135,10 @@ function! fugitive#LogComplete(A, L, P) abort return s:CompleteSub('log', a:A, a:L, a:P) endfunction -function! s:GrepParseLine(options, dir, line) abort - echo a:line +function! s:GrepParseLine(options, quiet, dir, line) abort + if !a:quiet + echo a:line + endif let entry = {'valid': 1} let match = matchlist(a:line, '^\(.\{-\}\):\([1-9]\d*\):\([1-9]\d*:\)\=\(.*\)$') if len(match) @@ -5193,7 +5195,7 @@ endfunction function! s:GrepCfile(result) abort 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') return [entry.filename, entry.lnum, "norm!" . entry.col . "|"] elseif has_key(entry, 'lnum') @@ -5265,7 +5267,7 @@ function! s:GrepSubcommand(line1, line2, range, bang, mods, options) abort let more = 1 set nomore 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') let press_enter_shortfall = &cmdheight - len(list) if press_enter_shortfall > 0