From 484d9846ef1e4e5ea1e9267b13a17ba17e4c624a Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Thu, 4 Nov 2010 19:44:28 -0400 Subject: [PATCH] Fix movement commands with counts in the graph. fixes issue 14 --- doc/gundo.txt | 1 + plugin/gundo.vim | 9 ++++----- site/index.html | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/gundo.txt b/doc/gundo.txt index 15c5366..77330a0 100644 --- a/doc/gundo.txt +++ b/doc/gundo.txt @@ -189,6 +189,7 @@ GitHub: http://github.com/sjl/gundo.vim/ Development version * Add the g:gundo_disable setting. + * Fix movement commands with counts in the graph. v1.0.0 * Initial stable release. diff --git a/plugin/gundo.vim b/plugin/gundo.vim index 370e358..526091b 100644 --- a/plugin/gundo.vim +++ b/plugin/gundo.vim @@ -707,14 +707,13 @@ endfunction"}}} "{{{ Gundo movement -function! s:GundoMove(direction)"{{{ +function! s:GundoMove(direction) range"{{{ let start_line = getline('.') + let distance = 2 * v:count1 - " If we're in between two nodes we move by one to get back on track. + " If we're in between two nodes we move by one less to get back on track. if stridx(start_line, '[') == -1 - let distance = 1 - else - let distance = 2 + let distance = distance - 1 endif let target_n = line('.') + (distance * a:direction) diff --git a/site/index.html b/site/index.html index 4a1d558..b51d500 100644 --- a/site/index.html +++ b/site/index.html @@ -331,6 +331,7 @@ let g:gundo_right = 1
  • Development version
  • v1.0.0