commit e716ebdda9cbc50a21af0c0cfa1d41b040e78bf8 (tree)
parent 771d1e37119c19b1ed3b170c1f68ee7d032414f0
Author: Tim Pope <code@tpope.net>
Date: Thu, 19 Aug 2021 16:45:09 -0400
Avoid more possibilities for :Ggrep more prompt
I think this could only happen with a screen one line high, but let's
avoid tempting fate
Diffstat:
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
@@ -5258,22 +5258,20 @@ function! s:GrepSubcommand(line1, line2, range, bang, mods, options) abort
\ 'file': s:Resolve(tempfile)}
let event = listnr < 0 ? 'grep-fugitive' : 'lgrep-fugitive'
silent exe s:DoAutocmd('QuickFixCmdPre ' . event)
- echo title
- let list = s:SystemList(s:UserCommandList(a:options) + cmd + args)[0]
- call writefile(list + [''], tempfile, 'b')
- call s:RunSave(state)
try
if &more
let more = 1
set nomore
endif
+ echo title
+ let list = s:SystemList(s:UserCommandList(a:options) + cmd + args)[0]
+ call writefile(list + [''], tempfile, 'b')
+ call s:RunSave(state)
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
echo repeat("\n", press_enter_shortfall - 1)
- elseif !a:bang && !empty(list)
- echo ""
endif
finally
if exists('l:more')
@@ -5283,7 +5281,7 @@ function! s:GrepSubcommand(line1, line2, range, bang, mods, options) abort
call s:RunFinished(state)
silent exe s:DoAutocmd('QuickFixCmdPost ' . event)
if !a:bang && !empty(list)
- return (listnr < 0 ? 'c' : 'l').'first'
+ return 'silent ' . (listnr < 0 ? 'c' : 'l').'first'
else
return ''
endif