Repository navigation
fix(diffs): preserve parsed blank-line change positions - #1142
Conversation
Parsing a patch could move blank-line changes to different rows, misaligning highlights and review comments with the source patch. Limit blank-line sliding to new or edited blocks during active editing. Keep untouched changes stable and restore parsed positions when editing ends. Leave similarity-based pairing unchanged. Fixes #1139
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c5e284011
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
Render a git patch whose added or removed blank line sits in the middle of a run of blank lines, load the files to edit it, then edit somewhere else in the file. The change highlight jumps to the top of the run on that first edit even though the blank line was untouched. The session rebuild re-parses the old and new files, and that parse reports a blank-run change at the bottom of the run. The lookup for the previous block only checked that one index, so a block the patch placed anywhere else in the run was treated as new and slid to the top. Let the slide callback return a distance instead of a yes/no, and search for the previous block at every position between the parsed bottom and the run's top. A match keeps the block where it was, which also covers blocks the session slid earlier; no match slides to the top as before. Runs longer than the parse context window still stop at the hunk edge and keep the bottom-of-run position.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ac6d3de22
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
Parsing a patch could move blank-line changes to different rows, misaligning highlights and review comments with the source patch.
Limit blank-line sliding to new or edited blocks during active editing. Keep untouched changes stable and restore parsed positions when editing ends. Leave similarity-based pairing unchanged.
Fixes #1139