mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-12-08 04:54:52 +08:00
Perform automatic :diffoff on :Gdiffsplit /external/file buffers
Closes https://github.com/tpope/vim-fugitive/issues/1402
This commit is contained in:
@@ -4525,15 +4525,12 @@ 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
|
endif
|
||||||
if s:Dir() ==# a:dir
|
|
||||||
call s:diffoff()
|
call s:diffoff()
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
endfor
|
endfor
|
||||||
execute curwin.'wincmd w'
|
execute curwin.'wincmd w'
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user