Skip to content

fix(diffs): preserve parsed blank-line change positions - #1142

Merged
amadeus merged 2 commits into
mainfrom
amadeus/fix-1139
Sep 19, 2026
Merged

amadeus merged 2 commits into
mainfrom
amadeus/fix-1139

Conversation

@amadeus

@amadeus amadeus commented Sep 18, 2026

Copy link
Copy Markdown
Member

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

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
@vercel

vercel Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pierre-diffshub Ready Ready Preview Sep 19, 2026 12:11am UTC
pierre-docs-diffs Ready Ready Preview Sep 19, 2026 12:11am UTC
pierre-docs-trees Ready Ready Preview Sep 19, 2026 12:11am UTC
pierrejs-diff-demo Ready Ready Preview Sep 19, 2026 12:11am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-19T00:13:48.578686Z 2ac6d3d Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.
@amadeus

amadeus commented Sep 19, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@amadeus
amadeus merged commit b39ca57 into main Sep 19, 2026
8 checks passed
@amadeus
amadeus deleted the amadeus/fix-1139 branch September 19, 2026 00:16

This branch was successfully deployed

4 active deployments
Preview – pierre-docs-diffs — 2ac6d3de Deployed Sep 19, 2026 by vercel[bot]
Preview – pierre-docs-trees — 2ac6d3de Deployed Sep 19, 2026 by vercel[bot]
Preview – pierre-diffshub — 2ac6d3de Deployed Sep 19, 2026 by vercel[bot]
Preview – pierrejs-diff-demo — 2ac6d3de Deployed Sep 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: processFile reports a blank-line change one line off the patch it was given (since 1.3.0)

1 participant