Skip to content

fix: multi-cursor overlapping selection ranges not pre-merged before input#748

Merged
xiaolai merged 1 commit intomainfrom
fix/audit-693
Apr 8, 2026
Merged

fix: multi-cursor overlapping selection ranges not pre-merged before input#748
xiaolai merged 1 commit intomainfrom
fix/audit-693

Conversation

@xiaolai
Copy link
Copy Markdown
Owner

@xiaolai xiaolai commented Apr 8, 2026

Summary

  • Pre-merge overlapping ranges via normalizeRangesWithPrimary() at the start of handleMultiCursorInput, handleMultiCursorBackspace, and handleMultiCursorDelete — prevents stale positions from corrupting edits
  • Added 4 tests covering overlapping ranges with input, backspace, delete, and a chain of 3 overlapping ranges

Test plan

  • 4 new tests in edgeCases.test.ts pass
  • All 17,757 tests pass (pnpm check:all)
  • Build succeeds

Closes #693

🤖 Generated with Claude Code

…ping selection ranges (Closes #693)

Pre-merge overlapping ranges via normalizeRangesWithPrimary() at the
start of handleMultiCursorInput, handleMultiCursorBackspace, and
handleMultiCursorDelete so stale positions don't corrupt edits.

Added 4 tests: overlapping ranges with input, backspace, delete, and
a chain of 3 overlapping ranges.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@xiaolai xiaolai added the audit Codebase audit finding label Apr 8, 2026
@xiaolai
Copy link
Copy Markdown
Owner Author

xiaolai commented Apr 8, 2026

VERIFIED — The PR adds the exact tests requested in #693 (overlapping ranges for input, backspace, and delete operations, plus a 3-range chain variant) and includes the corresponding pre-merge fix in inputHandling.ts that makes them pass, with no unrelated changes.

@xiaolai xiaolai enabled auto-merge (squash) April 8, 2026 15:03
@xiaolai xiaolai merged commit d04a096 into main Apr 8, 2026
8 checks passed
@xiaolai xiaolai deleted the fix/audit-693 branch April 8, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit Codebase audit finding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[audit] multi-cursor: no test coverage for input operations with overlapping selection ranges

1 participant