diff options
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 7b9601a5a6..1d29ae064e 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -124,7 +124,7 @@ // temporary buffer for rendering a single screenline, so it can be -// comparared with previous contents to calulate smallest delta. +// comparared with previous contents to calculate smallest delta. static size_t linebuf_size = 0; static schar_T *linebuf_char = NULL; static sattr_T *linebuf_attr = NULL; @@ -4021,10 +4021,13 @@ win_line ( if (wp->w_buffer->terminal) { // terminal buffers may need to highlight beyond the end of the // logical line - while (col < grid->Columns) { + int n = wp->w_p_rl ? -1 : 1; + while (col >= 0 && col < grid->Columns) { schar_from_ascii(linebuf_char[off], ' '); - linebuf_attr[off++] = term_attrs[vcol++]; - col++; + linebuf_attr[off] = term_attrs[vcol]; + off += n; + vcol += n; + col += n; } } grid_put_linebuf(grid, row, 0, col, grid->Columns, wp->w_p_rl, wp, |