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.
author |
Maciej Konieczny <hello@narf.pl> |
date |
Sun, 22 May 2011 21:54:55 +0200 |
parents |
321c5d51ee50
|
children |
2043d8723096
|
branches/tags |
(none) |
files |
plugin/gundo.vim |
Changes
--- 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()"{{{