diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-19 18:42:54 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-19 19:28:01 +0200 |
commit | cf0f83ebf0d74b11c1ffdc4d1066555f312a91ec (patch) | |
tree | 95b2d868504355e89385fb377b46527e8cf60087 /src/nvim | |
parent | 02ef104d5bcd40c048e8011e0106f30389034674 (diff) | |
download | rneovim-cf0f83ebf0d74b11c1ffdc4d1066555f312a91ec.tar.gz rneovim-cf0f83ebf0d74b11c1ffdc4d1066555f312a91ec.tar.bz2 rneovim-cf0f83ebf0d74b11c1ffdc4d1066555f312a91ec.zip |
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
Diffstat (limited to 'src/nvim')
-rw-r--r-- | src/nvim/move.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) { |