From a25d4d696172db1b40e3caa59109da8113a2f620 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 6 Aug 2021 21:09:17 -0400 Subject: [PATCH] Fix read command output into buffer with guioptions=! --- autoload/fugitive.vim | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 9fc7b5a..c47ec13 100644 --- 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))