# editor: Fix panic in \`text_layout_details\` pre layout \(\#55816\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 20620a8c08cb160b5a83c54f771aa022043d8d49

Requested commit: 20620a8c08cb160b5a83c54f771aa022043d8d49

Commit: 20620a8c08cb160b5a83c54f771aa022043d8d49

Tree: 465627437f648e27c5d9f6b5899f42ddc251abb1

Author: Agus Zubiaga

Committer: GitHub

## Message

```
editor: Fix panic in `text_layout_details` pre layout (#55816)

Fixes a panic at `Editor::text_layout_details` when called against an
editor whose element has never been laid out (i.e., `set_style` has
never been called, so the cached `style` is still `None`).

We've seen this crash once through a helix motion. The exact production
sequence isn't clear — for the editor to receive a vim action without
ever having been drawn, the active item would have to have changed
inside the same update tick that ends with the deferred `search_submit`,
which is narrow but not impossible (since it's dispatched by the
workspace, not the editor).

Release Notes:

- Fixed a rare panic when invoking helix motions on an editor that had
not yet been laid out.
```

## Parents

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

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