motiejus/dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.jakstys.lt/motiejus/dotfiles.git
Log | Tree | Refs | README | LICENSE

commit a38f25f78b429ccad1e2d2da82efb9678f34675d (tree)
parent 50e7887498acc9c23474d28df9ea60827a8356a9
Author: Tim Pope <code@tpope.net>
Date:   Sun, 12 Jun 2011 23:10:06 -0400

Close diffs when navigating from :Gstatus

Diffstat:
Mplugin/fugitive.vim | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim @@ -910,6 +910,16 @@ function! s:Edit(cmd,...) abort else if &previewwindow && getbufvar('','fugitive_type') ==# 'index' 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 return a:cmd.' '.s:fnameescape(file) endif