commit a25d4d696172db1b40e3caa59109da8113a2f620 (tree)
parent 2d0f51679c5035c9bcb7b4ab0efa8bd70813ab64
Author: Tim Pope <code@tpope.net>
Date: Fri, 6 Aug 2021 21:09:17 -0400
Fix read command output into buffer with guioptions=!
Diffstat:
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
@@ -5246,7 +5246,17 @@ endfunction
function! s:ReadExec(line1, count, range, mods, env, args, options) abort
let [read, post] = s:ReadPrepare(a:line1, a:count, a:range, a:mods)
let env = s:BuildEnvPrefix(extend({'COLUMNS': &tw ? &tw : 80}, a:env))
- silent execute read . '!' escape(env . s:UserCommand(a:options, ['--no-pager'] + a:args), '!#%')
+ try
+ if exists('+guioptions') && &guioptions =~# '!'
+ let guioptions = &guioptions
+ set guioptions-=!
+ endif
+ silent execute read . '!' escape(env . s:UserCommand(a:options, ['--no-pager'] + a:args), '!#%')
+ finally
+ if exists('guioptions')
+ let &guioptions = guioptions
+ endif
+ endtry
execute post
call fugitive#ReloadStatus(a:options.dir, 1)
return 'redraw|echo '.string(':!'.s:UserCommand(a:options, a:args))