summaryrefslogtreecommitdiffstats
path: root/src/drawscreen.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-04 20:35:37 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-04 20:35:37 +0100
commit18b3500b8c517e44c23197e558aa36aed1c6916c (patch)
tree36268ec8403ef62346b070af87e72193be696ad2 /src/drawscreen.c
parent2cd0f27b75c4497bec872819a965b3d6b4d55030 (diff)
patch 9.0.0661: multi-byte "lastline" in 'fillchars' does not work properlyv9.0.0661
Problem: Multi-byte "lastline" item in 'fillchars' does not work properly when the window is two columns wide. Solution: Compute the text length correctly. (closes #11280)
Diffstat (limited to 'src/drawscreen.c')
-rw-r--r--src/drawscreen.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/drawscreen.c b/src/drawscreen.c
index 3ad7e00cc7..fe54ef5d81 100644
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -2643,15 +2643,15 @@ win_update(win_T *wp)
{
int scr_row = W_WINROW(wp) + wp->w_height - 1;
int symbol = wp->w_fill_chars.lastline;
- int len;
+ int charlen;
char_u fillbuf[12]; // 2 characters of 6 bytes
- len = mb_char2bytes(symbol, &fillbuf[0]);
- len += mb_char2bytes(symbol, &fillbuf[len]);
+ charlen = mb_char2bytes(symbol, &fillbuf[0]);
+ mb_char2bytes(symbol, &fillbuf[charlen]);
// Last line isn't finished: Display "@@@" in the last screen line.
screen_puts_len(fillbuf,
- wp->w_width > 2 ? len : wp->w_width,
+ (wp->w_width > 2 ? 2 : wp->w_width) * charlen,
scr_row, wp->w_wincol, HL_ATTR(HLF_AT));
screen_fill(scr_row, scr_row + 1,
(int)wp->w_wincol + 2, (int)W_ENDCOL(wp),