From 6cd3aeee4c0fbd0751122395af0ab895abda027e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 14 Jan 2014 13:18:58 +0100 Subject: [PATCH] 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) --- src/normal.c | 5 ++++- src/testdir/test39.in | 6 ++++++ src/testdir/test39.ok | Bin 420 -> 432 bytes src/version.c | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/normal.c b/src/normal.c index f76aeee37e..66a5b7ab65 100644 --- 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 index 4f42a13a5e..8f45f47dc3 100644 --- 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 100644 GIT binary patch delta 20 bc-mXSyn%Vc5=Nfn{2VJ2h5WQMD+4Y7NNEN) delta 7 Oc-q^*yo7nf5=H