# HG changeset patch # User Steve Losh # Date 1286923727 14400 # Node ID 7f1c71ef51419d5409cbf13b8f6cf8b59f6793df # Parent 8637cdbbba8a2f7098659dffce0d23293330d01f Fix in-between line movement. diff -r 8637cdbbba8a -r 7f1c71ef5141 plugin/gundo.vim --- a/plugin/gundo.vim Tue Oct 12 18:44:51 2010 -0400 +++ b/plugin/gundo.vim Tue Oct 12 18:48:47 2010 -0400 @@ -23,12 +23,15 @@ "{{{ Movement Mappings function! s:GundoMoveUp() + let start_line = getline('.') if line('.') - 2 <= 4 - return + call cursor(5, 0) + elseif stridx(start_line, '[') == -1 + call cursor(line('.') - 1, 0) + else + call cursor(line('.') - 2, 0) endif - call cursor(line('.') - 2, 0) - let line = getline('.') let idx1 = stridx(line, '@') let idx2 = stridx(line, 'o') @@ -44,12 +47,15 @@ endfunction function! s:GundoMoveDown() + let start_line = getline('.') if line('.') + 2 >= line('$') - return + call cursor(line('$') - 1, 0) + elseif stridx(start_line, '[') == -1 + call cursor(line('.') + 1, 0) + else + call cursor(line('.') + 2, 0) endif - call cursor(line('.') + 2, 0) - let line = getline('.') let idx1 = stridx(line, '@') let idx2 = stridx(line, 'o')