helix: Fix paste in deleted diff hunks (#64245)

Closes ZED-73F

# Objective

Pasting in Helix mode while the cursor was inside an expanded deleted
diff hunk could create a selection past the buffer and crash.

## Solution

Track the inserted range with before/after anchors instead of deriving
it from the clipboard text length. If the edit is rejected for
non-editable diff text, both anchors resolve to an empty valid range.

## Testing

Added a regression test for pasting inside an expanded deleted hunk and
ran the Helix paste tests.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Fixed a crash when pasting in an expanded deleted diff hunk in Helix
mode
a95da07db2Agus Zubiaga committed on 9/15/2026, 3:27:26 PM· committed by GitHubparentaef893e
1 file changedLine totals unavailable