From be9ff95f27d12b7bd46ab5d36f7149cb0864c329 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 9 Jun 2021 19:02:25 -0400 Subject: [PATCH] Avoid guioptions=! issues in :Git --paginate Resolves: https://github.com/tpope/vim-fugitive/issues/1767 --- autoload/fugitive.vim | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index e64c6e2..eb49332 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2993,9 +2993,19 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort return 'call fugitive#Resume()|silent checktime' . after elseif pager is# 1 let pre = s:BuildEnvPrefix(env) - 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 + try + if exists('+guioptions') && &guioptions =~# '!' + 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! call s:RunSave(state) call s:RunFinished(state)