Skip to content

editor: Fix panic in text_layout_details pre layout - #55816

Merged
agu-z merged 1 commit into
mainfrom
fix-helix-text-layout-details-panic
May 5, 2026
Merged

editor: Fix panic in text_layout_details pre layout#55816
agu-z merged 1 commit into
mainfrom
fix-helix-text-layout-details-panic

Conversation

@agu-z

@agu-z agu-z commented May 5, 2026

Copy link
Copy Markdown
Contributor

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.

…d out

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.
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 5, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label May 5, 2026
@agu-z agu-z changed the title editor: Fix panic in text_layout_details when editor has not been laid out editor: Fix panic in text_layout_details pre layout May 5, 2026
@agu-z
agu-z requested review from benbrandt May 5, 2026 20:22
@agu-z
agu-z added this pull request to the merge queue May 5, 2026
Merged via the queue into main with commit 20620a8 May 5, 2026
44 checks passed
@agu-z
agu-z deleted the fix-helix-text-layout-details-panic branch May 5, 2026 21:49
ebaah46 pushed a commit to ebaah46/zed that referenced this pull request May 6, 2026
…#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.
@agu-z

agu-z commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

/cherry-pick stable

zed-zippy Bot added a commit that referenced this pull request May 7, 2026
…y-pick to stable) (#56062)

Cherry-pick of #55816 to stable

----
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.

Co-authored-by: Agus Zubiaga <agus@zed.dev>
@kylekz kylekz mentioned this pull request May 8, 2026
3 tasks
Nkr1shna pushed a commit to neozed-industries/neo-zed that referenced this pull request May 11, 2026
…#55816) (cherry-pick to stable) (zed-industries#56062)

Cherry-pick of zed-industries#55816 to stable

----
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.

Co-authored-by: Agus Zubiaga <agus@zed.dev>
Nkr1shna pushed a commit to neozed-industries/neo-zed that referenced this pull request May 13, 2026
…#55816) (cherry-pick to stable) (zed-industries#56062)

Cherry-pick of zed-industries#55816 to stable

----
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.

Co-authored-by: Agus Zubiaga <agus@zed.dev>
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
…#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.
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants