Put the preview page below the graph instead.
author |
Steve Losh <steve@dwaiter.com> |
date |
Wed, 13 Oct 2010 15:19:20 -0400 |
parents |
7100a024df57
|
children |
a5cc91b6f479
|
branches/tags |
(none) |
files |
doc/gundo.txt plugin/gundo.vim |
Changes
--- a/doc/gundo.txt Tue Oct 12 23:43:29 2010 -0400
+++ b/doc/gundo.txt Wed Oct 13 15:19:20 2010 -0400
@@ -44,23 +44,32 @@
Now you can press F5 to toggle the undo graph and preview pane, which will
look something like this: >
- Undo graph Preview pane File
- +-----------------------------------+-----------------------------+--------+
- | " Gundo for something.txt [1] |--- 3 2010-10-12 06:27:35 PM |one |
- | " j/k - move between undo states |+++ 5 2010-10-12 07:38:37 PM |two |
- | " <cr> - revert to that state |@@ -1,3 +1,4 |three |
- | | one |five |
- | @ [5] 3 hours ago | two | |
- | | | three | |
- | | o [4] 4 hours ago |+five | |
- | | | | | |
- | o | [3] 4 hours ago | | |
- | | | | | |
- | o | [2] 4 hours ago | | |
- | |/ | | |
- | o [1] 4 hours ago | | |
- | | | | |
- +-----------------------------------+-----------------------------+--------+
+ Undo graph File
+ +-----------------------------------+------------------------------------+
+ | " Gundo for something.txt [1] |one |
+ | " j/k - move between undo states |two |
+ | " <cr> - revert to that state |three |
+ | |five |
+ | @ [5] 3 hours ago | |
+ | | | |
+ | | o [4] 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
nodes are marked with an 'o' character.
--- a/plugin/gundo.vim Tue Oct 12 23:43:29 2010 -0400
+++ b/plugin/gundo.vim Wed Oct 13 15:19:20 2010 -0400
@@ -63,10 +63,10 @@
"{{{ Buffer/Window Management
function! s:GundoResizeBuffers(backto)
" 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 bufwinnr(bufwinnr('__Gundo_Preview__')) . "wincmd w"
- exe "vertical resize " . 40
+ exe bufwinnr(bufnr('__Gundo_Preview__')) . "wincmd w"
+ exe "resize " . 15
exe a:backto . "wincmd w"
endfunction
@@ -74,8 +74,7 @@
let existing_gundo_buffer = bufnr("__Gundo__")
if existing_gundo_buffer == -1
- exe "vnew __Gundo__"
- wincmd H
+ exe bufwinnr(bufnr('__Gundo_Preview__')) . "wincmd w"
call s:GundoResizeBuffers(winnr())
nnoremap <script> <silent> <buffer> <CR> :call <sid>GundoRevert()<CR>
nnoremap <script> <silent> <buffer> j :call <sid>GundoMove(1)<CR>
@@ -91,8 +90,8 @@
exe existing_gundo_window . "wincmd w"
endif
else
- exe "vsplit +buffer" . existing_gundo_buffer
- wincmd H
+ exe bufwinnr(bufnr('__Gundo_Preview__')) . "wincmd w"
+ exe "split +buffer" . existing_gundo_buffer
call s:GundoResizeBuffers(winnr())
endif
endif