From cf0f83ebf0d74b11c1ffdc4d1066555f312a91ec Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Fri, 19 May 2023 18:42:54 +0200 Subject: vim-patch:9.0.1568: with 'smoothscroll' cursor may move below botline Problem: With 'smoothscroll' cursor may move below botline. Solution: Call redraw_later() if needed, Compute cursor row with adjusted condition. (Luuk van Baal, closes vim/vim#12415) https://github.com/vim/vim/commit/d49f646bf56b29d44bbb16e79bc877b59aab38ac --- src/nvim/move.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/nvim') diff --git a/src/nvim/move.c b/src/nvim/move.c index c9b7ba4ae0..9e8abbcd96 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -415,6 +415,8 @@ void update_topline(win_T *wp) // When 'smoothscroll' is not set, should reset w_skipcol. if (!wp->w_p_sms) { reset_skipcol(wp); + } else if (wp->w_skipcol != 0) { + redraw_later(wp, UPD_SOME_VALID); } // May need to set w_skipcol when cursor in w_topline. @@ -659,7 +661,7 @@ static void curs_rows(win_T *wp) i--; // hold at inserted lines } } - if (valid && (lnum != wp->w_topline || !win_may_fill(wp))) { + if (valid && (lnum != wp->w_topline || (wp->w_skipcol == 0 && !win_may_fill(wp)))) { lnum = wp->w_lines[i].wl_lastlnum + 1; // Cursor inside folded lines, don't count this row if (lnum > wp->w_cursor.lnum) { -- cgit