diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-04-09 12:40:13 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-09 12:40:13 +0100 |
commit | cee9c844f27bceaba90362a3fa27a04d4d06c0fd (patch) | |
tree | 1904095957e43d03004d20826b501e258de0a823 /src/drawscreen.c | |
parent | a016eeba7a5777ba1f2ec2dbcda7c96823bf9ab1 (diff) | |
download | vim-git-cee9c844f27bceaba90362a3fa27a04d4d06c0fd.tar.gz |
patch 8.2.4718: @@@ in the last line sometimes drawn in the wrong placev8.2.4718
Problem: @@@ in the last line sometimes drawn in the wrong place.
Solution: Make sure the column is valid. (closes #10130)
Diffstat (limited to 'src/drawscreen.c')
-rw-r--r-- | src/drawscreen.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/drawscreen.c b/src/drawscreen.c index 9f9cb0960..135df1ea5 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -2617,8 +2617,8 @@ win_update(win_T *wp) int scr_row = W_WINROW(wp) + wp->w_height - 1; // Last line isn't finished: Display "@@@" in the last screen line. - screen_puts_len((char_u *)"@@", 2, scr_row, wp->w_wincol, - HL_ATTR(HLF_AT)); + screen_puts_len((char_u *)"@@", wp->w_width > 2 ? 2 : 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)); @@ -2627,10 +2627,13 @@ win_update(win_T *wp) } else if (dy_flags & DY_LASTLINE) // 'display' has "lastline" { + int start_col = (int)W_ENDCOL(wp) - 3; + // Last line isn't finished: Display "@@@" at the end. screen_fill(W_WINROW(wp) + wp->w_height - 1, W_WINROW(wp) + wp->w_height, - (int)W_ENDCOL(wp) - 3, (int)W_ENDCOL(wp), + start_col < wp->w_wincol ? wp->w_wincol : start_col, + (int)W_ENDCOL(wp), '@', '@', HL_ATTR(HLF_AT)); set_empty_rows(wp, srow); wp->w_botline = lnum; |