Put the preview page below the graph instead.

This commit is contained in:
Steve Losh 2010-10-13 15:19:20 -04:00
parent 06937adbb4
commit 8e4432a73f
2 changed files with 32 additions and 24 deletions

View File

@ -44,23 +44,32 @@ what the author uses.
Now you can press F5 to toggle the undo graph and preview pane, which will Now you can press F5 to toggle the undo graph and preview pane, which will
look something like this: > look something like this: >
Undo graph Preview pane File Undo graph File
+-----------------------------------+-----------------------------+--------+ +-----------------------------------+------------------------------------+
| " Gundo for something.txt [1] |--- 3 2010-10-12 06:27:35 PM |one | | " Gundo for something.txt [1] |one |
| " j/k - move between undo states |+++ 5 2010-10-12 07:38:37 PM |two | | " j/k - move between undo states |two |
| " <cr> - revert to that state |@@ -1,3 +1,4 |three | | " <cr> - revert to that state |three |
| | one |five | | |five |
| @ [5] 3 hours ago | two | | | @ [5] 3 hours ago | |
| | | three | | | | | |
| | o [4] 4 hours ago |+five | | | | o [4] 4 hours ago | |
| | | | | |
| o | [3] 4 hours ago | | |
| | | | | |
| o | [2] 4 hours ago | | |
| |/ | | |
| o [1] 4 hours ago | | |
| | | | | | | | | |
+-----------------------------------+-----------------------------+--------+ | o | [3] 4 hours ago | |
| | | | |
| o | [2] 4 hours ago | |
| |/ | |
| o [1] 4 hours ago | |
| | | |
+-----------------------------------+ |
| --- 3 2010-10-12 06:27:35 PM | |
| +++ 5 2010-10-12 07:38:37 PM | |
| @@ -1,3 +1,4 | |
| one | |
| two | |
| three | |
| +five | |
+-----------------------------------+------------------------------------+
Preview pane
Your current position in the undo tree is marked with an '@' character. Other Your current position in the undo tree is marked with an '@' character. Other
nodes are marked with an 'o' character. nodes are marked with an 'o' character.

View File

@ -63,10 +63,10 @@ endfunction
"{{{ Buffer/Window Management "{{{ Buffer/Window Management
function! s:GundoResizeBuffers(backto) function! s:GundoResizeBuffers(backto)
" This sucks and doesn't work. TODO: Fix it. " This sucks and doesn't work. TODO: Fix it.
exe bufwinnr(bufwinnr('__Gundo__')) . "wincmd w" exe bufwinnr(bufnr('__Gundo__')) . "wincmd w"
exe "vertical resize " . g:gundo_width exe "vertical resize " . g:gundo_width
exe bufwinnr(bufwinnr('__Gundo_Preview__')) . "wincmd w" exe bufwinnr(bufnr('__Gundo_Preview__')) . "wincmd w"
exe "vertical resize " . 40 exe "resize " . 15
exe a:backto . "wincmd w" exe a:backto . "wincmd w"
endfunction endfunction
@ -74,8 +74,7 @@ function! s:GundoOpenBuffer()
let existing_gundo_buffer = bufnr("__Gundo__") let existing_gundo_buffer = bufnr("__Gundo__")
if existing_gundo_buffer == -1 if existing_gundo_buffer == -1
exe "vnew __Gundo__" exe bufwinnr(bufnr('__Gundo_Preview__')) . "wincmd w"
wincmd H
call s:GundoResizeBuffers(winnr()) call s:GundoResizeBuffers(winnr())
nnoremap <script> <silent> <buffer> <CR> :call <sid>GundoRevert()<CR> nnoremap <script> <silent> <buffer> <CR> :call <sid>GundoRevert()<CR>
nnoremap <script> <silent> <buffer> j :call <sid>GundoMove(1)<CR> nnoremap <script> <silent> <buffer> j :call <sid>GundoMove(1)<CR>
@ -91,8 +90,8 @@ function! s:GundoOpenBuffer()
exe existing_gundo_window . "wincmd w" exe existing_gundo_window . "wincmd w"
endif endif
else else
exe "vsplit +buffer" . existing_gundo_buffer exe bufwinnr(bufnr('__Gundo_Preview__')) . "wincmd w"
wincmd H exe "split +buffer" . existing_gundo_buffer
call s:GundoResizeBuffers(winnr()) call s:GundoResizeBuffers(winnr())
endif endif
endif endif