RT-298: scroll through a diff line taller than the pane row by row - #459
Merged
Merged
Conversation
A changed line that wrapped to more rows than the diff pane pinned its first row on top, so its middle and end were unreachable. A cursor step on such a line now scrolls it one row until its far end is on screen, then moves to the next line; a line entered from below opens at its bottom. The wheel takes the same steps. The viewport clamps diffTop into the tall line's range, so a click or a stage keeps the rows being read. Staging and clicks still act on the whole line. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
Comment |
Collaborator
Author
|
@coderabbitai pause |
✅ Action performedReviews paused. |
Review of #459: an absolute diffTop carried a mid-line position onto a different tall line that a discard shifted under the cursor, and a resize re-wrapping the lines above jumped the reader to the line's top or bottom. The offset into the cursor line is now held with the line it belongs to, so a new line opens at its first row and a resize keeps the place within the line. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
RT-298. glitter's diff pane soft-wraps, but a changed line that wrapped to more rows than the pane (minified JS, one-line JSON) pinned its first row on top. Its middle and end could not be reached.
What changed
moveDiffCursortakes one step at a time: on a cursor line taller than the pane, a step scrolls it one row until its far end is on screen, then the cursor moves to the next linediffRowOff) belongs to the line it was set on: a stage keeps the rows being read, a resize keeps the place within the line, and a different line landing under the cursor (a discard, the same path in another commit) opens at its first rowtallCursorSpanreads the shareddiffRowIndexand the last pane height, so the index stays the one row map for render, viewport anddiffHitspace/s/dstill act on the whole lineVerification
go test ./...andgo vet ./...cleandiffTopcarried a mid-line position onto a different tall line and lost the place on resize; fixed and pinned by tests that fail on the absolute versionapp.min.js): down steps one row at a time through the line and then ontoconst b/tail; up from below opens the line atEND-OF-LONG-LINE; two wheel ticks move 6 rows; toggling the stage mid-line keeps the view🤖 Generated with Claude Code