aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-05-27 14:37:22 +0800
committerGitHub <noreply@github.com>2024-05-27 14:37:22 +0800
commit9a0239fdc8b380a8a32739a7c722fe90e3c2e910 (patch)
treedcdececca741c1a8d5bdfedbce2ec4f7c139552a /src
parentffbd09ef6acfbfac897be19d5ae847af6e6bd03d (diff)
downloadrneovim-9a0239fdc8b380a8a32739a7c722fe90e3c2e910.tar.gz
rneovim-9a0239fdc8b380a8a32739a7c722fe90e3c2e910.tar.bz2
rneovim-9a0239fdc8b380a8a32739a7c722fe90e3c2e910.zip
fix(drawline): don't draw beyond end of window (#29035)
Diffstat (limited to 'src')
-rw-r--r--src/nvim/drawline.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 07944081da..4d534d78a2 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -1596,6 +1596,10 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
// hide virt_text on text hidden by 'nowrap' or 'smoothscroll'
decor_redraw_col(wp, (colnr_T)(ptr - line) - 1, wlv.off, true, &decor_state);
}
+ if (wlv.col >= grid->cols) {
+ wlv.col = wlv.off = grid->cols;
+ goto end_check;
+ }
}
if (cul_screenline && wlv.filler_todo <= 0
@@ -2650,13 +2654,6 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
conceal_cursor_used = conceal_cursor_line(curwin);
}
- // When the window is too narrow draw all "@" lines.
- if (leftcols_width >= wp->w_grid.cols && is_wrapped) {
- 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;
- }
-
break;
}
@@ -2844,10 +2841,12 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
}
}
+end_check:
// At end of screen line and there is more to come: Display the line
// so far. If there is no more to display it is caught above.
if (wlv.col >= grid->cols && (!has_foldtext || virt_line_offset >= 0)
- && (*ptr != NUL
+ && (wlv.col <= leftcols_width
+ || *ptr != NUL
|| wlv.filler_todo > 0
|| (wp->w_p_list && wp->w_p_lcs_chars.eol != NUL && lcs_eol_todo)
|| (wlv.n_extra != 0 && (wlv.sc_extra != NUL || *wlv.p_extra != NUL))