mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-19 15:10:34 +01:00
2280e5d95e
## Summary Pasting multiple selections at the end of a file could crash Vim while saving paste marks, because their anchors are not necessarily in document order. Serialize those marks with a summarizer that reuses its cursors while moving forward and resets them when an anchor moves backward, preserving mark order. Fixes [FR-506](https://linear.app/zed-industries/issue/FR-506/zed-c22-cannot-summarize-backward-from-26-to-23). ## Testing In Vim mode, copy `abcdef` and `xyz` as two separate selections in Zed. Open a saved file containing `012345678901234567890` with no trailing newline, put one cursor on the final `0`, and press `p`. The paste should complete without crashing. ## Self-review - [x] I've reviewed my diff for quality, security, reliability, and performance. - [ ] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist) (not applicable). - [x] Tests cover the new or changed behavior. Release Notes: - Fixed a crash when pasting multiple selections at the end of a file in Vim mode.