# HG changeset patch # User Maciej Konieczny # Date 1306094095 -7200 # Node ID 0d92eaf03c6a607ebe021e0c2926b286a15534ff # Parent 321c5d51ee50a41952f00ab976c59553221c089e 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. diff -r 321c5d51ee50 -r 0d92eaf03c6a plugin/gundo.vim --- a/plugin/gundo.vim Mon May 09 21:10:50 2011 -0400 +++ b/plugin/gundo.vim Sun May 22 21:54:55 2011 +0200 @@ -598,11 +598,19 @@ 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()"{{{