Avoid -- More -- prompt during :Ggrep

Resolves: https://github.com/tpope/vim-fugitive/issues/1814
This commit is contained in:
Tim Pope
2021-08-19 16:33:09 -04:00
parent 81f293852e
commit 0cbc28ba33

View File

@@ -5260,12 +5260,24 @@ function! s:GrepSubcommand(line1, line2, range, bang, mods, options) abort
echo title echo title
let list = s:SystemList(s:UserCommandList(a:options) + cmd + args)[0] let list = s:SystemList(s:UserCommandList(a:options) + cmd + args)[0]
call writefile(list + [''], tempfile, 'b') call writefile(list + [''], tempfile, 'b')
call map(list, 's:GrepParseLine(options, dir, v:val)') try
call s:QuickfixSet(listnr, list, 'a') if &more
let press_enter_shortfall = &cmdheight - len(list) let more = 1
if press_enter_shortfall > 0 set nomore
echo repeat("\n", press_enter_shortfall - 1) endif
endif call map(list, 's:GrepParseLine(options, 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')
let &more = more
endif
endtry
call s:RunFinished(state) call s:RunFinished(state)
silent exe s:DoAutocmd('QuickFixCmdPost ' . event) silent exe s:DoAutocmd('QuickFixCmdPost ' . event)
if !a:bang && !empty(list) if !a:bang && !empty(list)