Close diffs when navigating from :Gstatus

This commit is contained in:
Tim Pope
2011-06-12 23:10:06 -04:00
parent 50e7887498
commit a38f25f78b

View File

@@ -910,6 +910,16 @@ function! s:Edit(cmd,...) abort
else else
if &previewwindow && getbufvar('','fugitive_type') ==# 'index' if &previewwindow && getbufvar('','fugitive_type') ==# 'index'
wincmd p wincmd p
if &diff
let mywinnr = winnr()
for winnr in range(winnr('$'),1,-1)
if winnr != mywinnr && getwinvar(winnr,'&diff')
execute winnr.'wincmd w'
close
wincmd p
endif
endfor
endif
endif endif
return a:cmd.' '.s:fnameescape(file) return a:cmd.' '.s:fnameescape(file)
endif endif