Buffer output when using the pager

As of 10ed587f65 all output is captured to
a temp file before being displayed. When the output is not buffered, the
stdout/stderr callback is called to perform post-processing for each
output chunk. Instead, buffer all output and perform the post-processing
all at once.

This results in a substantial performance improvement for repositories
with many commits.
This commit is contained in:
Gregory Anders
2023-12-15 14:50:56 -06:00
committed by Tim Pope
parent 46eaf8918b
commit 5965909358

View File

@@ -3933,6 +3933,8 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg, ...) abort
let job = jobstart(argv, extend(jobopts, {
\ 'pty': state.pty,
\ 'TERM': 'dumb',
\ 'stdout_buffered': pager,
\ 'stderr_buffered': pager,
\ 'on_stdout': function('s:RunReceive', [state, tmp, 'out']),
\ 'on_stderr': function('s:RunReceive', [state, tmp, 'err']),
\ 'on_exit': function('s:RunClose', [state, tmp]),