Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Smoothly autoscroll the editor when selecting with the mouse - #8548

Merged
nathansobo merged 3 commits into
masterfrom
ns-improve-mouse-based-autoscroll
Aug 28, 2015
Merged

nathansobo merged 3 commits into
masterfrom
ns-improve-mouse-based-autoscroll

Conversation

@nathansobo

Copy link
Copy Markdown
Contributor

Fixes #8539
Fixes #6722

Our current approach to autoscrolling when selecting with the mouse relies on the same code path as our keyboard-based autoscrolling. This makes it feel jerky and also makes it especially hard to control at small editor sizes.

This PR uses a different code path to autoscroll when selecting with the mouse, providing a smoother and more controlled experience. The scroll speed is a quadratic function of the mouse cursor's distance beyond the edge of the editor viewport, and I'm open to adjusting the parameters if anyone wants to experiment or pull something from another codebase.

comfy-scroll

  • Experiment with a mouse-specific autoscroll code path
  • Test coverage for new code
  • Fix existing broken tests

@maxbrunsfeld

Copy link
Copy Markdown
Contributor

🎇

@nathansobo
nathansobo force-pushed the ns-improve-mouse-based-autoscroll branch from 5a9a666 to 012f8e4 Compare August 28, 2015 18:57
@nathansobo

Copy link
Copy Markdown
Contributor Author

@izuzak any interest in playing with this? I may merge it once it's green and we can adjust it from there if needed.

@izuzak

izuzak commented Aug 28, 2015

Copy link
Copy Markdown
Contributor

@nathansobo Just took it for a test 🚗 and it looks and feels great! Didn't notice any problems so far ⚡

nathansobo pushed a commit that referenced this pull request Aug 28, 2015
Smoothly autoscroll the editor when selecting with the mouse
@nathansobo
nathansobo merged commit 020c11d into master Aug 28, 2015
@nathansobo
nathansobo deleted the ns-improve-mouse-based-autoscroll branch August 28, 2015 19:46
@nathansobo

Copy link
Copy Markdown
Contributor Author

Thanks for testing it. 🙇

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants