Mercurial > vim
diff src/drawscreen.c @ 30643:dfb02f9dcbe8 v9.0.0656
patch 9.0.0656: cannot specify another character to use instead of '@'
Commit: https://github.com/vim/vim/commit/4ba5f1dab656103e8f4a4505452d1816b9e83c1e
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Oct 4 14:36:29 2022 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 04 Oct 2022 15:45:03 +0200 |
parents | 604d7d7aa043 |
children | 101f08b49ed3 |
line wrap: on
line diff
--- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -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; } }