]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.147 v7.4.147
authorBram Moolenaar <Bram@vim.org>
Tue, 14 Jan 2014 12:18:58 +0000 (13:18 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 14 Jan 2014 12:18:58 +0000 (13:18 +0100)
Problem:    Cursor moves to wrong position when using "gj" after "$" and
            virtual editing is active.
Solution:   Make "gj" behave differently when virtual editing is active.
            (Hirohito Higashi)

src/normal.c
src/testdir/test39.in
src/testdir/test39.ok
src/version.c

index f76aeee37efc7f57e244483048e7fa7621360e6c..66a5b7ab65a2d738d2550dc1f19dc6eb0aa31734 100644 (file)
@@ -4644,7 +4644,10 @@ nv_screengo(oap, dir, dist)
     }
 #endif
 
-    coladvance(curwin->w_curswant);
+    if (virtual_active() && atend)
+       coladvance(MAXCOL);
+    else
+       coladvance(curwin->w_curswant);
 
 #if defined(FEAT_LINEBREAK) || defined(FEAT_MBYTE)
     if (curwin->w_cursor.col > 0 && curwin->w_p_wrap)
index 4f42a13a5ead47aa5e1f1afb8b66cb280c3d4d3f..8f45f47dc3be74547bacda60a24d3b88ac43cced 100644 (file)
@@ -52,6 +52,12 @@ ddppi333\ek0i222\efyllvjfuUk
 G3o123456789\e2k05l\162jr\rG3o98765\e2k02l\162jr\16\r
 G3o123456789\e2k05l\162jr
 G3o98765\e2k02l\162jr\16
+:"
+:" Test cursor position. When ve=block and Visual block mode and $gj
+:set ve=block
+:exe ":norm! 2k\<C-V>$gj\<Esc>"
+:let cpos=getpos("'>")
+:$put ='col:'.cpos[2].' off:'.cpos[3]
 :/^the/,$w >> test.out
 :qa!
 ENDTEST
index 3469f52b65c944c6d79c39b21ee2eb6b12739030..b459355c6ad756d297b58653a563c6c385360202 100644 (file)
Binary files a/src/testdir/test39.ok and b/src/testdir/test39.ok differ
index 7be350c7d48a85c9029c10a59ae1eeca290bd70f..c9fa779e06b2ff830ac29c244a9207fed32ae98e 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    147,
 /**/
     146,
 /**/