Horizontal scroll for long lines#37
Merged
Merged
Conversation
Wire up trackpad/shift-wheel horizontal scroll in the editor pane so long lines like Homebrew formula URLs or SHA strings are reachable without moving the cursor. A muted '<' / '>' glyph at the leftmost / rightmost content cell signals when content extends off-screen — a terminal has no scrollbar to convey this otherwise. - Tab.ScrollH mirrors Tab.Scroll on the horizontal axis. - app.scrollAtH dispatches WheelLeft/WheelRight inside the editor pane only (the tree has nothing useful to scroll horizontally). - Tab.Render paints the overflow indicators after the per-row content loop using th.Muted so they read as affordances, not content.
Most terminals — including macOS Terminal and the common zellij/tmux setups people SSH into — never emit native WheelLeft/WheelRight, even when the trackpad swipe is horizontal. The vertical wheel event just arrives with ModShift set instead, matching the VS Code convention. Honor that as the primary path; keep the WheelLeft/Right branch as a bonus for terminals that do support it.
Zellij — over both macOS Terminal and iTerm2 — splits shift+wheel into two separate events: a ButtonNone+Shift 'modifier state' event, then an unmodified WheelDown/Up. With the modifier dropped from the wheel event itself, our previous check (ev.Modifiers()&ModShift) never saw shift and the wheel scrolled vertically. Track the wall-clock time of the most recent Shift-bearing event and treat any wheel within 250ms as shifted. Verified end-to-end against a captured event log from Zellij + macOS Terminal where the sequence ButtonNone+Shift → WheelDown(none) appears reliably; the new TestHandleMouse_ShiftStickyForWheel feeds that exact sequence.
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
ScrollX, so long lines (Homebrew URLs, SHA strings, etc.) are reachable without dragging the cursor along‹/›glyph at the leftmost / rightmost content cell signals off-screen content — without it a terminal user has no way to know horizontal scroll is availableTest plan
make test— race-detector run, all green locally›appears at the right edge when content is cut off‹appears at the left edgeEnsureVisiblebehavior, regression-checked)