Repository navigation
feat: scroll views with the mouse wheel - #98
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The mouse wheel now scrolls, behaving exactly like the up and down arrow keys.
App::scroll_line_up/scroll_line_down, so the wheel scrolls whatever has focus: the help screen, an open overlay (describe, command confirm, profile picker), or the active view's selection. A list behind an open overlay or help does not move.ui::terminal::suspend_tui) so the shell does not receive mouse escape sequences, restored on resume, and disabled on exit.Tradeoff
Capturing the mouse means plain click-and-drag no longer selects terminal text while the app runs. Most terminals bypass capture with a modifier held while dragging (Shift in most Linux terminals, Option in iTerm2, Fn in macOS Terminal). The README notes this under the controls.
Validation
cargo fmt --all --checkcargo clippy --all-targets -- -D warningscargo test --all(230 passed), including new tests that a line of scroll moves the list selection within bounds and goes to help or an open overlay instead of the list behind it