patch 9.1.0201: gM not working correctly with virt text
Problem: `gM` would include outer virtual text and its padding when
getting the line length used to calculate the middle of the
line, putting the cursor much closer to virtual text lines.
Solution: Exclude outer virtual text in getting the line length for
`gM`, so that virtual text doesn't influence where the cursor
is moved to (Dylan Thacker-Smith).
closes: #14262
Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
b2d124c625
commit
366c81a200
@ -6066,7 +6066,7 @@ nv_g_cmd(cmdarg_T *cap)
|
||||
{
|
||||
oap->motion_type = MCHAR;
|
||||
oap->inclusive = FALSE;
|
||||
i = linetabsize(curwin, curwin->w_cursor.lnum);
|
||||
i = linetabsize_no_outer(curwin, curwin->w_cursor.lnum);
|
||||
if (cap->count0 > 0 && cap->count0 <= 100)
|
||||
coladvance((colnr_T)(i * cap->count0 / 100));
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user