summaryrefslogtreecommitdiff
path: root/src/normal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-07-09 17:08:29 +0200
committerBram Moolenaar <Bram@vim.org>2013-07-09 17:08:29 +0200
commitb69510e889a1eb102bce83567a7b958d2f25b6ff (patch)
treed015136967853fa6097e2ddbe8deb601aec461d0 /src/normal.c
parentdd007ed5853507f2071c3a152645088abf3c910b (diff)
downloadvim-git-b69510e889a1eb102bce83567a7b958d2f25b6ff.tar.gz
updated for version 7.4a.007v7.4a.007
Problem: After "g$" with 'virtualedit' set, "k" moves to a different column. (Dimitar Dimitrov) Solution: Set w_curswant. (Christian Brabandt)
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/normal.c b/src/normal.c
index b16ac8725..762f3197b 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -8220,6 +8220,11 @@ nv_g_cmd(cap)
i += ((curwin->w_virtcol - width1) / width2 + 1)
* width2;
coladvance((colnr_T)i);
+
+ /* Make sure we stick in this column. */
+ validate_virtcol();
+ curwin->w_curswant = curwin->w_virtcol;
+ curwin->w_set_curswant = FALSE;
#if defined(FEAT_LINEBREAK) || defined(FEAT_MBYTE)
if (curwin->w_cursor.col > 0 && curwin->w_p_wrap)
{
@@ -8228,7 +8233,6 @@ nv_g_cmd(cap)
* the end of the line. We do not want to advance to
* the next screen line.
*/
- validate_virtcol();
if (curwin->w_virtcol > (colnr_T)i)
--curwin->w_cursor.col;
}