Files
zed/crates
Tim Vermeulen bcf8c7bee7 Fix crash in Editor::rotate_selections using cursors on nonconsecutive lines (#63937)
Crash repro:

```
A
1234567890
B
C
```
1. place cursors before `A`, `B`, and `C`
2. run `editor: rotate selections forward`

Caused by the current `Editor::rotate_selections` logic assuming that
the text between the end of one of the lines being rotated and the start
of the next one is just the newline:
```rs
let newline_len = line_ranges[1].start.0 - line_ranges[0].end.0;
```
which fails when those lines aren't consecutive in the editor.

## 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
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Fixed crash in `editor: rotate selections forward` and `editor: rotate
selections backward` using cursors on nonconsecutive lines.
2026-09-08 20:13:56 +00:00
..
2026-08-09 22:29:52 +00:00
2026-09-04 22:54:09 +00:00
…
2026-09-02 18:21:25 +00:00
…
2026-09-02 18:21:25 +00:00
2026-08-09 22:29:52 +00:00
2026-05-27 10:31:53 +00:00
2026-08-09 22:29:52 +00:00