Repository navigation
fix(editor): preserve viewport during non-wrapped screen-line motion - #415
Merged
Merged
Conversation
Contributor
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
When
j/kare mapped toMoveScreenLineDown/MoveScreenLineUp, disabling wrapping makes each movement scroll the document while keeping the cursor on the same screen row. Withscrolloff = 3, moving from line 30 to 31 scrolls the first visible line from 27 to 28. The old implementation also restricts destinations to rows already in the viewport.Resolve non-wrapped destinations from buffer lines and use the existing cursor-reveal policy, so movement preserves the viewport until the cursor reaches its scroll margin and can continue past either viewport edge. Wrapped movement keeps its existing implementation.
Add a regression in
tests/movement.rscomparing screen-line and ordinary vertical movement through a long document in both directions, including file boundaries andscrolloffvalues of 0 and 3.How to Test
wrap = false,scrolloff = 3, and normal-modej/kmapped toMoveScreenLineDown/MoveScreenLineUp. Pressjrepeatedly: the cursor should move down the screen, with scrolling starting only at the bottom margin. Reverse withkand expect the same behavior at the top margin.scrolloff = 0. Movement should cross both viewport edges and reach the beginning/end of the file without getting stuck. Enable wrapping and verifygj/gkstill move through wrapped segments.cargo test --test movementandcargo clippy --all-targets --all-features -- -D warnings.Validation: reproduced the original issue interactively on installed Red 0.9.1 and confirmed ordinary
MoveDowndoes not exhibit it.git diff --checkpasses. The new regression and Clippy are blocked before compilation because the configured dependency registry does not provide the existing lockedzip 9.0.4dependency (it offers versions through 9.0.3). The fix has not yet been built or smoke-tested.