summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 36396e8d28..243593a523 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4221,7 +4221,7 @@ build_stl_str_hl(
stl_hlrec_T **tabtab) // return: tab page nrs (can be NULL)
{
linenr_T lnum;
- size_t len;
+ colnr_T len;
char_u *p;
char_u *s;
char_u *t;
@@ -4328,12 +4328,12 @@ build_stl_str_hl(
// Get the byte value now, in case we need it below. This is more efficient
// than making a copy of the line.
- len = STRLEN(p);
- if (wp->w_cursor.col > (colnr_T)len)
+ len = ml_get_buf_len(wp->w_buffer, lnum);
+ if (wp->w_cursor.col > len)
{
// Line may have changed since checking the cursor column, or the lnum
// was adjusted above.
- wp->w_cursor.col = (colnr_T)len;
+ wp->w_cursor.col = len;
wp->w_cursor.coladd = 0;
byteval = 0;
}