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

Smooth scrolling doesn't consistently respect scroll boundaries #55

Open
obar opened this issue May 12, 2020 · 0 comments
Open

Smooth scrolling doesn't consistently respect scroll boundaries #55

obar opened this issue May 12, 2020 · 0 comments

Comments

@obar
Copy link
Contributor

obar commented May 12, 2020

Other scroll commands work with sublimity-scroll, but I have issues with C-n at the bottom of a window. C-p at the top operates as expected.

This was a head-scratcher, but after digging into it a bit, I believe the criteria for scrolling doesn't work as expected for partial lines of text at the bottom of the window, which is never an issue at the top as it starts with a completely visible line. Sublimity doesn't expect to scroll yet when C-n moves point to that partially visible line, but emacs scrolls it to visible anyway edit to clarify: without smooth scrolling behavior. Per the documentation of window-end used in the criteria:

Note that the position it returns might be only partially visible.

Other motion that ends on a partially visible line would result in the same problem (eg, forward-paragraph) but one doesn't run into that condition as often.

I have a fix for this particular problem and will submit a pull request. It's not perfect as the method I used doesn't take into account scroll-margin—if that's non-zero then motion into those margins at the window boundaries will not give smooth scrolling.

obar added a commit to obar/sublimity that referenced this issue May 12, 2020
Addresses zk-phi#55 for `C-n` at bottom of a window showing part of a line
of text. Does not take `scroll-margin` into account.
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

No branches or pull requests

1 participant