# HG changeset patch # User Steve Losh # Date 1286631484 14400 # Node ID 2513c9fd4319880718f2b02e2551b28cc74a41dd # Parent 82d190d1da64764163ae7b02b1ff2a2b963af9df Fix up and down. diff -r 82d190d1da64 -r 2513c9fd4319 plugin/gundo.vim --- a/plugin/gundo.vim Sat Oct 09 09:00:41 2010 -0400 +++ b/plugin/gundo.vim Sat Oct 09 09:38:04 2010 -0400 @@ -19,6 +19,32 @@ let g:gundo_width = 45 endif +function! s:GundoMoveUp() + call cursor(line('.') - 2, 0) + + let line = getline('.') + let idx1 = stridx(line, '@') + let idx2 = stridx(line, 'o') + if idx1 != -1 + call cursor(0, idx1 + 1) + else + call cursor(0, idx2 + 1) + endif +endfunction + +function! s:GundoMoveDown() + call cursor(line('.') + 2, 0) + + let line = getline('.') + let idx1 = stridx(line, '@') + let idx2 = stridx(line, 'o') + if idx1 != -1 + call cursor(0, idx1 + 1) + else + call cursor(0, idx2 + 1) + endif +endfunction + function! s:GundoOpenBuffer() let existing_gundo_buffer = bufnr("__Gundo__") @@ -27,8 +53,8 @@ wincmd H exe "vertical resize " . g:gundo_width nnoremap