mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-27 02:50:30 +01:00
a95da07db2
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