# HG changeset patch # User Bram Moolenaar # Date 1389701938 -3600 # Node ID d289f2167d702c87493d1934db863df29676e261 # Parent 9e9ca74c57530d327102fe17cfb305c3a75d6f48 updated for version 7.4.147 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) diff --git a/src/normal.c b/src/normal.c --- a/src/normal.c +++ b/src/normal.c @@ -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) diff --git a/src/testdir/test39.in b/src/testdir/test39.in --- a/src/testdir/test39.in +++ b/src/testdir/test39.in @@ -52,6 +52,12 @@ ddppi333k0i222fyllvjfuUk G3o1234567892k05l2jr G3o987652k02l2jr G3o1234567892k05l2jr G3o987652k02l2jr +:" +:" Test cursor position. When ve=block and Visual block mode and $gj +:set ve=block +:exe ":norm! 2k\$gj\" +:let cpos=getpos("'>") +:$put ='col:'.cpos[2].' off:'.cpos[3] :/^the/,$w >> test.out :qa! ENDTEST diff --git a/src/testdir/test39.ok b/src/testdir/test39.ok index 3469f52b65c944c6d79c39b21ee2eb6b12739030..b459355c6ad756d297b58653a563c6c385360202 GIT binary patch literal 432 zc$|fe-A=+l5QV*U65rvx0EyjgDdi4q6HJJ`pqt3${uNZ9F|i5tWqlQ=8$mD-=i-~4 zbI#1_efMds^Yv=|^7^*fl4jwZ3&3{Q+#=Lp)7QNTTyt0K28B=e%8#!#z#wA`z#wZa zz#!)wz#y6ksSU-+Fy%&5A#pN3987IeqK~!5vQ(8?EDELIca8?=N*;ss++sl0tT@dS zPdP&j8d}X7%VRFX*@;4#* OOWSP5F`Bv_-_tj6!*ovo diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -739,6 +739,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 147, +/**/ 146, /**/ 145,