summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-01-14 13:18:58 +0100
committerBram Moolenaar <Bram@vim.org>2014-01-14 13:18:58 +0100
commit6cd3aeee4c0fbd0751122395af0ab895abda027e (patch)
tree2969ceff007c4341114aafe9f11cd4ee9cb8f227
parent2cd3696c35877e2b3e8826336fb37833a3dfa4b6 (diff)
downloadvim-git-6cd3aeee4c0fbd0751122395af0ab895abda027e.tar.gz
updated for version 7.4.147v7.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)
-rw-r--r--src/normal.c5
-rw-r--r--src/testdir/test39.in6
-rw-r--r--src/testdir/test39.okbin420 -> 432 bytes
-rw-r--r--src/version.c2
4 files changed, 12 insertions, 1 deletions
diff --git a/src/normal.c b/src/normal.c
index f76aeee37..66a5b7ab6 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 4f42a13a5..8f45f47dc 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\<C-V>$gj\<Esc>"
+: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 3469f52b6..b459355c6 100644
--- a/src/testdir/test39.ok
+++ b/src/testdir/test39.ok
Binary files differ
diff --git a/src/version.c b/src/version.c
index 7be350c7d..c9fa779e0 100644
--- 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,