aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/drawline.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-01-04 14:07:25 +0100
committerbfredl <bjorn.linse@gmail.com>2024-01-11 19:53:21 +0100
commit478b1af511b2ce9ecaeade910ce227b900b83429 (patch)
tree334cc7e14a57d688ddc4038dda678c04b2eb57d2 /src/nvim/drawline.c
parentd54156ed08b84e6c7f22334a4f3a4d4f84798604 (diff)
downloadrneovim-478b1af511b2ce9ecaeade910ce227b900b83429.tar.gz
rneovim-478b1af511b2ce9ecaeade910ce227b900b83429.tar.bz2
rneovim-478b1af511b2ce9ecaeade910ce227b900b83429.zip
refactor(screen): simplify grid_clear() and win_draw_end()
grid_put_linebuf() used grid_clear() internally to handle clearing the left part of a rightleft line. By reimplementing that internally, we can instead use grid_put_linebuf() as the implementation of grid_clear(), which in the end is a net reduction of code as grid_fill() is used for nothing else. win_draw_end: Implement "draw_margin" on a per-row basis which closer reflects how terminals work. Also use the magic mirror for 'rightleft'
Diffstat (limited to 'src/nvim/drawline.c')
-rw-r--r--src/nvim/drawline.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index a4d98f09f4..aae374c8a7 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -2611,8 +2611,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl
// When the window is too narrow draw all "@" lines.
if (leftcols_width >= wp->w_grid.cols && wp->w_p_wrap) {
- win_draw_end(wp, schar_from_ascii('@'), schar_from_ascii(' '), true, wlv.row,
- wp->w_grid.rows, HLF_AT);
+ win_draw_end(wp, schar_from_ascii('@'), true, wlv.row, wp->w_grid.rows, HLF_AT);
set_empty_rows(wp, wlv.row);
wlv.row = endrow;
}
@@ -2836,8 +2835,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl
// When the window is too narrow draw all "@" lines.
if (wlv.col <= leftcols_width) {
- win_draw_end(wp, schar_from_ascii('@'), schar_from_ascii(' '), true, wlv.row,
- wp->w_grid.rows, HLF_AT);
+ win_draw_end(wp, schar_from_ascii('@'), true, wlv.row, wp->w_grid.rows, HLF_AT);
set_empty_rows(wp, wlv.row);
wlv.row = endrow;
}
@@ -2883,8 +2881,7 @@ static void win_put_linebuf(win_T *wp, int row, int coloff, int endcol, int clea
int start_col = 0;
if (wp->w_p_rl) {
- linebuf_mirror(&start_col, &clear_width, grid->cols);
- endcol = grid->cols - 1 - endcol;
+ linebuf_mirror(&start_col, &endcol, &clear_width, grid->cols);
}
// Take care of putting "<<<" on the first line for 'smoothscroll'.