Skip to content

Conversation

@zeertzjq
Copy link
Member

@zeertzjq zeertzjq commented Oct 27, 2025

Problem: Wrong display with 'smoothscroll' when FEAT_DIFF is disabled.
Solution: Use plines_correct_topline().

Comment on lines -2345 to +2340
{
#ifdef FEAT_DIFF
if (l == wp->w_topline)
{
int n = plines_win_nofill(wp, l, FALSE)
+ wp->w_topfill;
n -= adjust_plines_for_skipcol(wp);
if (n > wp->w_height)
n = wp->w_height;
new_rows += n;
}
else
#endif
new_rows += plines_win(wp, l, TRUE);
}
new_rows += plines_correct_topline(wp, l, TRUE);
Copy link
Member Author

@zeertzjq zeertzjq Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The effect of limit_winheight is a bit different when using plines_correct_topline(), but it doesn't matter here, as when line height (including or excluding filler lines) exceeds w_height, the new_rows > wp->w_height - row - 2 condition below will be true, and new_rows will be overwritten.

@chrisbra
Copy link
Member

Do you have a test which shows this behaviour?

@zeertzjq
Copy link
Member Author

zeertzjq commented Oct 27, 2025

The existing tests already cover this. Build without FEAT_DIFF and run test_scroll_opt.

Problem:  Wrong display with 'smoothscroll' when FEAT_DIFF is disabled.
Solution: Use plines_correct_topline().
@chrisbra
Copy link
Member

Ah, okay got it. Thanks

@chrisbra chrisbra closed this in e06e70f Oct 28, 2025
@zeertzjq zeertzjq deleted the smoothscroll branch October 28, 2025 22:48
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Oct 28, 2025
Problem:  Wrong display with 'smoothscroll' when FEAT_DIFF is disabled.
Solution: Use plines_correct_topline() (zeertzjq).

closes: vim/vim#18649

vim/vim@e06e70f
zeertzjq added a commit to neovim/neovim that referenced this pull request Oct 28, 2025
)

Problem:  Wrong display with 'smoothscroll' when FEAT_DIFF is disabled.
Solution: Use plines_correct_topline() (zeertzjq).

closes: vim/vim#18649

vim/vim@e06e70f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants