Avoid guioptions=! issues in :Git --paginate

Resolves: https://github.com/tpope/vim-fugitive/issues/1767
This commit is contained in:
Tim Pope
2021-06-09 19:02:25 -04:00
parent c26b4b018a
commit be9ff95f27

View File

@@ -2993,9 +2993,19 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
return 'call fugitive#Resume()|silent checktime' . after return 'call fugitive#Resume()|silent checktime' . after
elseif pager is# 1 elseif pager is# 1
let pre = s:BuildEnvPrefix(env) let pre = s:BuildEnvPrefix(env)
silent! execute '!' . escape(pre . s:UserCommand({'git': git, 'dir': dir}, s:disable_colors + flags + ['--no-pager'] + args), '!#%') . try
\ (&shell =~# 'csh' ? ' >& ' . s:shellesc(state.file) : ' > ' . s:shellesc(state.file) . ' 2>&1') if exists('+guioptions') && &guioptions =~# '!'
let state.exit_status = v:shell_error let guioptions = &guioptions
set guioptions-=!
endif
silent! execute '!' . escape(pre . s:UserCommand({'git': git, 'dir': dir}, s:disable_colors + flags + ['--no-pager'] + args), '!#%') .
\ (&shell =~# 'csh' ? ' >& ' . s:shellesc(state.file) : ' > ' . s:shellesc(state.file) . ' 2>&1')
let state.exit_status = v:shell_error
finally
if exists('guioptions')
let &guioptions = guioptions
endif
endtry
redraw! redraw!
call s:RunSave(state) call s:RunSave(state)
call s:RunFinished(state) call s:RunFinished(state)