From eed46c1f24f91a0819c312dde1f34503d7906074 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 21 Nov 2019 22:08:37 -0500 Subject: [PATCH] Perform automatic :diffoff on :Gdiffsplit /external/file buffers Closes https://github.com/tpope/vim-fugitive/issues/1402 --- autoload/fugitive.vim | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 9bd089c..8f25832 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -4525,14 +4525,11 @@ endfunction function! s:diffoff_all(dir) abort let curwin = winnr() for nr in range(1,winnr('$')) - if getwinvar(nr,'&diff') + if getwinvar(nr, '&diff') && !empty(getwinvar(nr, 'fugitive_diff_restore')) if nr != winnr() execute nr.'wincmd w' - let restorewinnr = 1 - endif - if s:Dir() ==# a:dir - call s:diffoff() endif + call s:diffoff() endif endfor execute curwin.'wincmd w'