# editor: Immediately cancel popover task if the hover ends before the popover is shown \(\#53168\) · gitcafe/zed

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

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

Visibility: public

Requested revision: c6772f83cabbc108114d34f6ae1b3b11a0f17972

Requested commit: c6772f83cabbc108114d34f6ae1b3b11a0f17972

Commit: c6772f83cabbc108114d34f6ae1b3b11a0f17972

Tree: a6550f03013be04e0204ab20c12ae95a27637652

Author: Tim Vermeulen

Committer: GitHub

## Message

```
editor: Immediately cancel popover task if the hover ends before the popover is shown (#53168)

Hover popovers aren't immediately dismissed when the hover ends, but
this delay mechanism is currently causing popovers to sometimes still
briefly appear when the hover lasted too short to have triggered it.
Fixed by immediately cancelling the popover task when the hover ends
before the popover is displayed.

Most easily reproduced when setting the hover popover delay to a value
lower than the default 300ms (but it still happens sometimes with the
default value), because the popover hide delay is also 300ms. Here's it
with `"hover_popover_delay": 200`:


https://github.com/user-attachments/assets/6415d112-d8e0-4a87-9a79-a7ab559f20f2

After the fix:


https://github.com/user-attachments/assets/34782389-de4c-4a25-bd6e-4858b55028de

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:

- Fixed hover popovers sometimes briefly appearing after the hover
already ended.

---------

Co-authored-by: Lukas Wirth <lukas@zed.dev>
```

## Parents

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

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