diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/drawline.c | 5 | ||||
-rw-r--r-- | src/nvim/grid.c | 14 | ||||
-rw-r--r-- | src/nvim/grid_defs.h | 2 |
3 files changed, 13 insertions, 8 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index cbe586d103..869fcdf7c0 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -2621,12 +2621,11 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s // linebuf_vcol[] already filled by the for loop above wlv.off++; wlv.col++; + wlv.vcol++; - if (vcol_hlc(wlv) >= rightmost_vcol) { + if (vcol_hlc(wlv) > rightmost_vcol) { break; } - - wlv.vcol++; } } diff --git a/src/nvim/grid.c b/src/nvim/grid.c index e911e6ad21..f51cdc478a 100644 --- a/src/nvim/grid.c +++ b/src/nvim/grid.c @@ -750,10 +750,15 @@ void grid_put_linebuf(ScreenGrid *grid, int row, int coloff, int col, int endcol } int clear_dirty_start = -1, clear_end = -1; + if (flags & SLF_RIGHTLEFT) { + for (col = clear_width - 1; col >= clear_start; col--) { + size_t off = off_to + (size_t)col; + grid->vcols[off] = (flags & SLF_INC_VCOL) ? ++last_vcol : last_vcol; + } + } // blank out the rest of the line // TODO(bfredl): we could cache winline widths - col = clear_start; - while (col < clear_width) { + for (col = clear_start; col < clear_width; col++) { size_t off = off_to + (size_t)col; if (grid->chars[off] != schar_from_ascii(' ') || grid->attrs[off] != bg_attr @@ -765,8 +770,9 @@ void grid_put_linebuf(ScreenGrid *grid, int row, int coloff, int col, int endcol } clear_end = col + 1; } - grid->vcols[off] = (flags & SLF_INC_VCOL) ? ++last_vcol : last_vcol; - col++; + if (!(flags & SLF_RIGHTLEFT)) { + grid->vcols[off] = (flags & SLF_INC_VCOL) ? ++last_vcol : last_vcol; + } } if ((flags & SLF_RIGHTLEFT) && start_dirty != -1 && clear_dirty_start != -1) { diff --git a/src/nvim/grid_defs.h b/src/nvim/grid_defs.h index 10a6161171..ac67f42fe0 100644 --- a/src/nvim/grid_defs.h +++ b/src/nvim/grid_defs.h @@ -37,7 +37,7 @@ enum { /// attrs[] contains the highlighting attribute for each cell. /// /// vcols[] contains the virtual columns in the line. -1 means not available -/// or before buffer text, MAXCOL means after the end of the line. +/// or before buffer text. /// -2 or -3 means in fold column and a mouse click should: /// -2: open a fold /// -3: close a fold |