diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-26 15:19:56 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-26 15:19:56 +0100 |
commit | 838b746cce7ea863acdb81e3f44eec2ea90de92a (patch) | |
tree | 666feb45d3cbb40f9591a101bddc26032ca484e0 /src/message.c | |
parent | 4569020538f76cab588f723bd7243e3896937568 (diff) |
patch 9.0.0592: display not cleared when scrolling back in messagesv9.0.0592
Problem: Display not cleared when scrolling back in messages, a background
color is set and t_ut is empty.
Solution: Clear to the end of the display if needed. (closes #8973)
Diffstat (limited to 'src/message.c')
-rw-r--r-- | src/message.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/message.c b/src/message.c index 9c35543031..ee11758ff0 100644 --- a/src/message.c +++ b/src/message.c @@ -2913,10 +2913,11 @@ msg_sb_eol(void) /* * Display a screen line from previously displayed text at row "row". + * When "clear_to_eol" is set clear the rest of the screen line. * Returns a pointer to the text for the next line (can be NULL). */ static msgchunk_T * -disp_sb_line(int row, msgchunk_T *smp) +disp_sb_line(int row, msgchunk_T *smp, int clear_to_eol) { msgchunk_T *mp = smp; char_u *p; @@ -2929,6 +2930,12 @@ disp_sb_line(int row, msgchunk_T *smp) if (*p == '\n') // don't display the line break ++p; msg_puts_display(p, -1, mp->sb_attr, TRUE); + + // If clearing the screen did not work (e.g. because of a background + // color and t_ut isn't set) clear until the last column here. + if (clear_to_eol) + screen_fill(row, row + 1, msg_col, (int)Columns, ' ', ' ', 0); + if (mp->sb_eol || mp->sb_next == NULL) break; mp = mp->sb_next; @@ -3279,15 +3286,16 @@ do_more_prompt(int typed_char) (int)Rows, 0, NULL) == OK) { // display line at top - (void)disp_sb_line(0, mp); + (void)disp_sb_line(0, mp, FALSE); } else { + int did_clear = screenclear(); + // redisplay all lines - screenclear(); for (i = 0; mp != NULL && i < Rows - 1; ++i) { - mp = disp_sb_line(i, mp); + mp = disp_sb_line(i, mp, !did_clear); ++msg_scrolled; } } @@ -3304,7 +3312,7 @@ do_more_prompt(int typed_char) inc_msg_scrolled(); screen_fill((int)Rows - 2, (int)Rows - 1, 0, (int)Columns, ' ', ' ', 0); - mp_last = disp_sb_line((int)Rows - 2, mp_last); + mp_last = disp_sb_line((int)Rows - 2, mp_last, FALSE); --toscroll; } } |