vim: Fix paste crash with out-of-order marks (#64876)
## 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.
2280e5d95eAgus Zubiaga committed on 9/28/2026, 3:53:53 PM· committed by GitHubparent986828d