0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.0.1273: "1v" may select block with wrong size

Problem:    "1v" may select block with wrong size. (Evgeni Chasnovski)
Solution:   Compute "curswant" in the right line. (closes #11925)
This commit is contained in:
Bram Moolenaar
2023-02-01 17:33:18 +00:00
parent e8d4ae0d11
commit 8f531662e2
3 changed files with 19 additions and 1 deletions

View File

@@ -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