Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infinite loop & signed overflow with 'smoothscroll' set #14068

Closed
wants to merge 1 commit into from

Conversation

seandewar
Copy link
Contributor

@seandewar seandewar commented Feb 21, 2024

A fix for a random thing I noticed yesterday.

Also sneak in some missing changes I forgot to add to my previous PR (sorry!), and relocate Test_smoothscroll_in_zero_width_window to test_scroll_opt.vim, which feels more appropriate.

(Maybe it's possible for Vim to still draw some buffer text within the gaps of the textoff area when cpo+=n if the window isn't 0-width, but it seems Vim currently doesn't do that)

Problem: infinite loop in win_update with 'smoothscroll' set when window width
is equal to textoff, or signed integer overflow if smaller.

Solution: don't revalidate wp->w_skipcol in that case, as no buffer text is
being shown.

Don't instead reset w_skipcol; that would lose the scroll position within the
line, which may be undesirable if the window is made wider later.

Also include changes from the splitmove PR that I (in my infinite Git wisdom)
forgot to commit. This includes a change to Test_window_split_no_room to ensure
it doesn't fail for some screen sizes.

Move Test_smoothscroll_in_zero_width_window to test_scroll_opt.vim, as that file
feels more appropriate.
@chrisbra
Copy link
Member

thanks!

@chrisbra chrisbra closed this in 02fcae0 Feb 21, 2024
@seandewar seandewar deleted the smoothscroll-overflow branch February 21, 2024 18:54
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.

None yet

2 participants