0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 9.0.0656: cannot specify another character to use instead of '@'

Problem:    Cannot specify another character to use instead of '@' at the end
            of the window.
Solution:   Add "lastline" to 'fillchars'. (Martin Tournoij, closes #11264,
            closes #10963)
This commit is contained in:
Bram Moolenaar
2022-10-04 14:36:29 +01:00
parent 2f7e1b8b40
commit 4ba5f1dab6
17 changed files with 120 additions and 24 deletions

View File

@@ -2643,33 +2643,42 @@ win_update(win_T *wp)
#endif
else if (dy_flags & DY_TRUNCATE) // 'display' has "truncate"
{
int scr_row = W_WINROW(wp) + wp->w_height - 1;
int scr_row = W_WINROW(wp) + wp->w_height - 1;
int symbol = wp->w_fill_chars.lastline;
int len;
char_u fillbuf[12]; // 2 characters of 6 bytes
len = mb_char2bytes(symbol, &fillbuf[0]);
len += mb_char2bytes(symbol, &fillbuf[len]);
// Last line isn't finished: Display "@@@" in the last screen line.
screen_puts_len((char_u *)"@@", wp->w_width > 2 ? 2 : wp->w_width,
scr_row, wp->w_wincol, HL_ATTR(HLF_AT));
screen_puts_len(fillbuf,
wp->w_width > 2 ? len : wp->w_width,
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),
'@', ' ', HL_ATTR(HLF_AT));
symbol, ' ', HL_ATTR(HLF_AT));
set_empty_rows(wp, srow);
wp->w_botline = lnum;
}
else if (dy_flags & DY_LASTLINE) // 'display' has "lastline"
{
int start_col = (int)W_ENDCOL(wp) - 3;
int symbol = wp->w_fill_chars.lastline;
// Last line isn't finished: Display "@@@" at the end.
screen_fill(W_WINROW(wp) + wp->w_height - 1,
W_WINROW(wp) + wp->w_height,
start_col < wp->w_wincol ? wp->w_wincol : start_col,
(int)W_ENDCOL(wp),
'@', '@', HL_ATTR(HLF_AT));
symbol, symbol, HL_ATTR(HLF_AT));
set_empty_rows(wp, srow);
wp->w_botline = lnum;
}
else
{
win_draw_end(wp, '@', ' ', TRUE, srow, wp->w_height, HLF_AT);
win_draw_end(wp, wp->w_fill_chars.lastline, ' ', TRUE,
srow, wp->w_height, HLF_AT);
wp->w_botline = lnum;
}
}