Skip to content

[diffs/edit] Fix dedupe line edits and preserve blank lines on indent - #992

Merged
ije merged 2 commits into
beta-1.3from
ije/fix-indent-dedupe
Jul 15, 2026
Merged

[diffs/edit] Fix dedupe line edits and preserve blank lines on indent#992
ije merged 2 commits into
beta-1.3from
ije/fix-indent-dedupe

Conversation

@ije

@ije ije commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator
  • Line indent/outdent multi-selection dedupe (3) — indent dispatch
    concatenates per-selection edits with no shared-line dedupe, so a line under
    two carets/ranges indents twice; the outdent variant emits two identical
    deletes that fail overlap validation and the whole command throws.
  • Block indent dirties blank lines (1) — a multi-line block indent inserts
    the indent unit on empty and whitespace-only lines inside the selection,
    injecting trailing whitespace on lines the user never touched (outdent
    round-trips it away, bounding the damage).

Deduplicate shared-line edits across multiple selections to prevent double
indentation and overlapping outdent deletes. Skip empty and whitespace-only
lines during block indentation.

  • Dedupes line-based indent/outdent edits with a Set, while preserving each selection’s caret remapping.
  • Multi-line block indent now skips empty and whitespace-only lines in the existing linear pass.

@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 3:55pm
pierre-docs-diffshub Ready Ready Preview Jul 15, 2026 3:55pm
pierre-docs-trees Ready Ready Preview Jul 15, 2026 3:55pm
pierrejs-diff-demo Ready Ready Preview Jul 15, 2026 3:55pm

Request 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: de169a21b0

ℹ️ 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".

Comment thread packages/diffs/src/editor/selection.ts Outdated
@ije
ije requested review from amadeus, fat and necolas July 15, 2026 14:07
@ije
ije merged commit 499976e into beta-1.3 Jul 15, 2026
8 checks passed
@ije
ije deleted the ije/fix-indent-dedupe branch July 15, 2026 16:29
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