diff options
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/screen.c b/src/screen.c index 08b1c018f2..71ddbcaab2 100644 --- a/src/screen.c +++ b/src/screen.c @@ -18,8 +18,7 @@ * displayed (excluding text written by external commands). * ScreenAttrs[off] Contains the associated attributes. * ScreenCols[off] Contains the virtual columns in the line. -1 means not - * available or before buffer text, MAXCOL means after the - * end of the line. + * available or before buffer text. * * LineOffset[row] Contains the offset into ScreenLines*[], ScreenAttrs[] * and ScreenCols[] for each line. @@ -509,6 +508,8 @@ screen_line( // Clear rest first, because it's left of the text. if (clear_width > 0) { + int clear_start = col; + while (col <= endcol && ScreenLines[off_to] == ' ' && ScreenAttrs[off_to] == 0 && (!enc_utf8 || ScreenLinesUC[off_to] == 0)) @@ -519,6 +520,10 @@ screen_line( if (col <= endcol) screen_fill(row, row + 1, col + coloff, endcol + coloff + 1, ' ', ' ', 0); + + for (int i = endcol; i >= clear_start; i--) + ScreenCols[off_to + (i - col)] = + (flags & SLF_INC_VCOL) ? ++last_vcol : last_vcol; } col = endcol + 1; off_to = LineOffset[row] + col + coloff; |