vim-patch:9.0.1000: with 'smoothscroll' skipcol may be reset unnecessarily

Problem:    With 'smoothscroll' skipcol may be reset unnecessarily.
Solution:   Check the line does actually fit in the window.

b21b8e9ed0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Luuk van Baal
2023-04-28 12:36:11 +02:00
parent c25fd85c2e
commit 6fd7e3bea4
3 changed files with 12 additions and 9 deletions

View File

@@ -1465,7 +1465,10 @@ void adjust_skipcol(void)
bool scrolled = false;
validate_cheight();
if (curwin->w_cline_height == curwin->w_height) {
if (curwin->w_cline_height == curwin->w_height
// w_cline_height may be capped at w_height, check there aren't
// actually more lines.
&& plines_win(curwin, curwin->w_cursor.lnum, false) <= curwin->w_height) {
// the line just fits in the window, don't scroll
reset_skipcol(curwin);
return;