summaryrefslogtreecommitdiffstats
path: root/src/normal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-02-01 17:33:18 +0000
committerBram Moolenaar <Bram@vim.org>2023-02-01 17:33:18 +0000
commit8f531662e28c37560bf5ac20a059bf00d01ee5a4 (patch)
tree5939384cb899ffb6d2c7cc57739898cb7690e83f /src/normal.c
parente8d4ae0d1153ecb45ebf48030be60640e8800540 (diff)
patch 9.0.1273: "1v" may select block with wrong sizev9.0.1273
Problem: "1v" may select block with wrong size. (Evgeni Chasnovski) Solution: Compute "curswant" in the right line. (closes #11925)
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/normal.c b/src/normal.c
index 0bd6655f2d..9a3006705c 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -5493,8 +5493,13 @@ nv_visual(cmdarg_T *cap)
}
else if (VIsual_mode == Ctrl_V)
{
+ // Update curswant on the original line, that is where "col" is
+ // valid.
+ linenr_T lnum = curwin->w_cursor.lnum;
+ curwin->w_cursor.lnum = VIsual.lnum;
update_curswant_force();
- curwin->w_curswant += + resel_VIsual_vcol * cap->count0 - 1;
+ curwin->w_curswant += resel_VIsual_vcol * cap->count0 - 1;
+ curwin->w_cursor.lnum = lnum;
coladvance(curwin->w_curswant);
}
else