From fc9daff259b3c240eae437863fc360490af31979 Mon Sep 17 00:00:00 2001 From: Maciej Konieczny Date: Sun, 22 May 2011 21:54:55 +0200 Subject: [PATCH] Fix window positions. Graph and diff windows were swapped if user set `splitbelow` to 1: :set splitbelow :set nosplitbelow +---+---+ +---+---+ | D | | | G | | +---+ S | +---+ S | | G | | | D | | +---+---+ +---+---+ D - diff, G - graph, S - source This commit fixes this -- now diff is displayed below graph regardless of `splitbelow` setting. --- plugin/gundo.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugin/gundo.vim b/plugin/gundo.vim index 90abc51..29f1e9b 100644 --- a/plugin/gundo.vim +++ b/plugin/gundo.vim @@ -598,11 +598,19 @@ function! s:GundoClose()"{{{ endfunction"}}} function! s:GundoOpen()"{{{ + " Save `splitbelow` value and set it to default to avoid problems with + " positioning new windows. + let saved_splitbelow = &splitbelow + let &splitbelow = 0 + call s:GundoOpenPreview() exe bufwinnr(g:gundo_target_n) . "wincmd w" call s:GundoRenderGraph() call s:GundoRenderPreview() + + " Restore `splitbelow` value. + let &splitbelow = saved_splitbelow endfunction"}}} function! s:GundoToggle()"{{{