# Fix split diff stale scroll anchor crash \(\#58688\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/f1268a12333f356bd3435cf5c2db658bf3207460)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: f1268a12333f356bd3435cf5c2db658bf3207460

Requested commit: f1268a12333f356bd3435cf5c2db658bf3207460

Commit: f1268a12333f356bd3435cf5c2db658bf3207460

Tree: 8bf0c5ead5bcc98b5375b27519dba36a759d4fc3

Author: Anthony Eid

Committer: GitHub

## Message

```
Fix split diff stale scroll anchor crash (#58688)

This crash occurred when the left hand side (LHS) editor in the split
diff retained a stale shared scroll handler after the split editor
unsplits. I added an invariant check to our randomized companion display
map tests to prevent regressions here and explicitly make LHS editor set
a native scroll anchor when unsplitting.

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

Release Notes:

- Fix crash that could occur when unsplitting a side by side diff view
```

## Parents

- [56b71271c4d95f3c76afa37c33bfa73f1367a947](https://git.cafe/gitcafe/zed/commit/56b71271c4d95f3c76afa37c33bfa73f1367a947?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/f1268a12333f356bd3435cf5c2db658bf3207460?format=markdown)
