summaryrefslogtreecommitdiffstats
path: root/src/normal.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-27 11:17:39 +0200
committerChristian Brabandt <cb@256bit.org>2023-08-27 11:17:39 +0200
commitd809c0a90387a23aed21ba37d0b65332fb5dafe7 (patch)
tree2d1e407ab6d503b26fdd1adce5a3b86a4e5c7156 /src/normal.c
parent58f39d89a8adff51ab04893d1fd28e3767979f9f (diff)
patch 9.0.1792: problem with gj/gk/gM and virtual textv9.0.1792
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>
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/normal.c b/src/normal.c
index 38229e96e5..b73afd3212 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -2304,7 +2304,7 @@ find_decl(
static int
nv_screengo(oparg_T *oap, int dir, long dist)
{
- int linelen = linetabsize_str(ml_get_curline());
+ int linelen = linetabsize(curwin, curwin->w_cursor.lnum);
int retval = OK;
int atend = FALSE;
int n;
@@ -2374,7 +2374,7 @@ nv_screengo(oparg_T *oap, int dir, long dist)
}
cursor_up_inner(curwin, 1);
- linelen = linetabsize_str(ml_get_curline());
+ linelen = linetabsize(curwin, curwin->w_cursor.lnum);
if (linelen > width1)
curwin->w_curswant += (((linelen - width1 - 1) / width2)
+ 1) * width2;
@@ -2411,7 +2411,7 @@ nv_screengo(oparg_T *oap, int dir, long dist)
// clipped to column 0.
if (curwin->w_curswant >= width1)
curwin->w_curswant -= width2;
- linelen = linetabsize_str(ml_get_curline());
+ linelen = linetabsize(curwin, curwin->w_cursor.lnum);
}
}
}
@@ -6052,7 +6052,7 @@ nv_g_cmd(cmdarg_T *cap)
{
oap->motion_type = MCHAR;
oap->inclusive = FALSE;
- i = linetabsize_str(ml_get_curline());
+ i = linetabsize(curwin, curwin->w_cursor.lnum);
if (cap->count0 > 0 && cap->count0 <= 100)
coladvance((colnr_T)(i * cap->count0 / 100));
else