Mercurial > vim
changeset 5600:d289f2167d70 v7.4.147
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)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 14 Jan 2014 13:18:58 +0100 |
parents | 9e9ca74c5753 |
children | ea05ca9d8a30 |
files | src/normal.c src/testdir/test39.in src/testdir/test39.ok src/version.c |
diffstat | 4 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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)
--- 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\<C-V>$gj\<Esc>" +:let cpos=getpos("'>") +:$put ='col:'.cpos[2].' off:'.cpos[3] :/^the/,$w >> test.out :qa! ENDTEST
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<VbU~fYCo|-al$YF8MM8-Fe%G9(q?E_qFW<J|(@4lTp>&j8d}X7%VRFX*@;4#* OOWSP5F`Bv_-_tj6!*ovo