cbfa66a2be7a

Fix movement commands with counts in the graph.

fixes issue 14
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 04 Nov 2010 19:44:28 -0400
parents c2222517b5da
children b58795eee108
branches/tags (none)
files doc/gundo.txt plugin/gundo.vim site/index.html

Changes

--- a/doc/gundo.txt	Tue Nov 02 00:10:04 2010 -0400
+++ b/doc/gundo.txt	Thu Nov 04 19:44:28 2010 -0400
@@ -189,6 +189,7 @@
 
 Development version
     * Add the g:gundo_disable setting.
+    * Fix movement commands with counts in the graph.
 v1.0.0
     * Initial stable release.
 
--- a/plugin/gundo.vim	Tue Nov 02 00:10:04 2010 -0400
+++ b/plugin/gundo.vim	Thu Nov 04 19:44:28 2010 -0400
@@ -707,14 +707,13 @@
 
 "{{{ 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)
--- a/site/index.html	Tue Nov 02 00:10:04 2010 -0400
+++ b/site/index.html	Thu Nov 04 19:44:28 2010 -0400
@@ -331,6 +331,7 @@
                     <li>Development version
                         <ul>
                             <li>Add the <code>g:gundo_disable</code> setting.</li>
+                            <li>Fix movement commands with counts in the graph.</li>
                         </ul>
                     </li>
                     <li>v1.0.0