Perform automatic :diffoff on :Gdiffsplit /external/file buffers

Closes https://github.com/tpope/vim-fugitive/issues/1402
This commit is contained in:
Tim Pope
2019-11-21 22:08:37 -05:00
parent dc5320630d
commit eed46c1f24

View File

@@ -4525,14 +4525,11 @@ endfunction
function! s:diffoff_all(dir) abort function! s:diffoff_all(dir) abort
let curwin = winnr() let curwin = winnr()
for nr in range(1,winnr('$')) for nr in range(1,winnr('$'))
if getwinvar(nr,'&diff') if getwinvar(nr, '&diff') && !empty(getwinvar(nr, 'fugitive_diff_restore'))
if nr != winnr() if nr != winnr()
execute nr.'wincmd w' execute nr.'wincmd w'
let restorewinnr = 1
endif
if s:Dir() ==# a:dir
call s:diffoff()
endif endif
call s:diffoff()
endif endif
endfor endfor
execute curwin.'wincmd w' execute curwin.'wincmd w'