patch 9.0.1792: problem with gj/gk/gM and virtual text
Problem: Normal mode "gM", "gj", "gk" commands behave incorrectly with
virtual text.
Solution: Use linetabsize() instead of linetabsize_str().
closes: #12909
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
diff --git a/src/misc2.c b/src/misc2.c
index 458e62b..169eb51 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -150,7 +150,7 @@
if ((addspaces || finetune) && !VIsual_active)
{
- curwin->w_curswant = linetabsize_str(line) + one_more;
+ curwin->w_curswant = linetabsize(curwin, pos->lnum) + one_more;
if (curwin->w_curswant > 0)
--curwin->w_curswant;
}
@@ -166,7 +166,7 @@
&& wcol >= (colnr_T)width
&& width > 0)
{
- csize = linetabsize_str(line);
+ csize = linetabsize(curwin, pos->lnum);
if (csize > 0)
csize--;