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(scrollbar): use cursorline to determine thumb position #267

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

willothy
Copy link
Contributor

@willothy willothy commented Nov 5, 2024

Problem: The scrollbar doesn't touch the bottom of the window when scrolled to the bottom of the list.
Solution: Use the cursorline for positioning the thumb instead of topline

@Saghen
Copy link
Owner

Saghen commented Nov 5, 2024

This causes the scrollbar to go down even when the topline hasn't changed though. How about we subtract the height of the window before dividing by the line count?

@willothy
Copy link
Contributor Author

willothy commented Nov 5, 2024

This causes the scrollbar to go down even when the topline hasn't changed though. How about we subtract the height of the window before dividing by the line count?

Hmm, I didn't see that as a downside but I get why that might not be ideal. Sounds good, I'll update that now!

Problem: The scrollbar doesn't touch the bottom of the window when scrolled to the bottom of the list.
Solution: Use the cursorline for positioning the thumb instead of topline
@willothy
Copy link
Contributor Author

willothy commented Nov 5, 2024

Updated, I think you're right - it looks much better this way :)

@Saghen Saghen merged commit 28fcf95 into Saghen:main Nov 5, 2024
@Saghen
Copy link
Owner

Saghen commented Nov 5, 2024

Sweet, thank you!

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