From 8e631401815f30f346ecf1b0c7ddc67f1f7d2918 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 6 Oct 2015 23:57:56 -0400 Subject: [PATCH] Resplit when :Gstatus is final window --- plugin/fugitive.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index cf64e8d..e0f60d4 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1333,7 +1333,12 @@ function! s:Edit(cmd,bang,...) abort let buffer = s:buffer() if a:cmd !~# 'read' if &previewwindow && getbufvar('','fugitive_type') ==# 'index' - wincmd p + if winnr('$') == 1 + let tabs = (&go =~# 'e' || !has('gui_running')) && &stal && (tabpagenr('$') >= &stal) + execute 'rightbelow' (&lines - &previewheight - &cmdheight - tabs - 1 - !!&laststatus).'new' + else + wincmd p + endif if &diff let mywinnr = winnr() for winnr in range(winnr('$'),1,-1)