Skip to content

[diffs/edit] Fix search-replace capture expansion with lookaround#994

Merged
ije merged 2 commits into
beta-1.3from
ije/fix-search-replace-capture-expansion
Jul 15, 2026
Merged

[diffs/edit] Fix search-replace capture expansion with lookaround#994
ije merged 2 commits into
beta-1.3from
ije/fix-search-replace-capture-expansion

Conversation

@ije

@ije ije commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Search-replace capture expansion with lookaround (3) — replacement-text
expansion re-executes the pattern against only the matched slice, so
lookaround context outside the slice is lost: a lookbehind whose context sits
before the slice, a lookahead whose context sits after the slice, and a
lookahead that re-matches shorter on the slice all fall back to inserting the
literal (unexpanded) replacement text.

Fixed search-replace capture expansion with lookaround.

  • Re-executes regex against the full line at the original match offset.
  • Validates the exact match range before expanding captures.

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
pierre-docs-diffs Ready Ready Preview Jul 15, 2026 4:30pm
pierre-docs-diffshub Ready Ready Preview Jul 15, 2026 4:30pm
pierre-docs-trees Ready Ready Preview Jul 15, 2026 4:30pm
pierrejs-diff-demo Ready Ready Preview Jul 15, 2026 4:30pm

Request Review

@ije
ije requested review from amadeus, fat and necolas July 15, 2026 14:06
@ije

ije commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 7865bbb5b7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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.

2 participants