Add better scroll wheel support and option to disable acceleration #1566
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
macOS applies a acceleration to the mouse scroll wheel which is often frustrating to use. In particular, a single click on the scroll wheel generates a fractional scroll, which doesn't do anything in MacVim as it scrolls by line. Fix this by forcing each scroll event to scroll at least one line (this is configurable to be higher, or 0 which means use the old behavior).
Also add an option to simply turn off acceleration and scroll a fixed number of lines.
Also, fix horizontal scrolling using mouse wheel. In macOS, the way to scroll horizontally using a normal wheel is to hold Shift key and scroll, and the OS will convert that to a horizontal scroll event. However, we were sending the shift modifier to Vim as well, which interprets it as which is not what we want (this scrolls a whole page). We manually remove the shift modifier when we detect this. It does mean there's functionally no way to send shift-scroll wheel events to Vim, but it is ok, as macOS generally works this way and it's consistent with how native GUI apps work.