From b1c439cef6cae54745f3bf446596c1b7e417c80e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 19 Jun 2024 09:20:24 +0800 Subject: fix(drawline): don't draw beyond end of window with 'rnu' (#29406) --- src/nvim/drawline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim') diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 6109652f7d..579b237af6 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -1553,7 +1553,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s // When only updating the columns and that's done, stop here. if (col_rows > 0) { - wlv_put_linebuf(wp, &wlv, wlv.off, false, bg_attr, 0); + wlv_put_linebuf(wp, &wlv, MIN(wlv.off, grid->cols), false, bg_attr, 0); // Need to update more screen lines if: // - 'statuscolumn' needs to be drawn, or // - LineNrAbove or LineNrBelow is used, or -- cgit