# Fix fold-related panic \(\#4008\) · gitcafe/zed

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

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

Visibility: public

Requested revision: b907f375a3e3fb752fa46d2bc629e5cb9b6f6df7

Requested commit: b907f375a3e3fb752fa46d2bc629e5cb9b6f6df7

Commit: b907f375a3e3fb752fa46d2bc629e5cb9b6f6df7

Tree: 490f71072fdade1d66fe8f0b3581fb5dc6c0339c

Author: Conrad Irwin

Committer: GitHub

## Message

```
Fix fold-related panic (#4008)

Although it's not super clear why this fails; in zed1 we used to have a
bounds
check. Restoring the bounds check for now, but leaving a debug_assert!
in case
a local reproduction happens.

Release Notes:

- Fix a panic that happened sometimes when rendering folds
```

## Parents

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

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

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