# Don't keep stale predictions in if they were discarded \(\#52334\) · gitcafe/zed

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

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

Visibility: public

Requested revision: b5fc09e40515cc5a97a7c91de8fb6e5bebb9c447

Requested commit: b5fc09e40515cc5a97a7c91de8fb6e5bebb9c447

Commit: b5fc09e40515cc5a97a7c91de8fb6e5bebb9c447

Tree: 62308617fb082866b283521a23b314cb98e03047

Author: Ben Kunkle

Committer: GitHub

## Message

```
Don't keep stale predictions in if they were discarded (#52334)

## Context

We're seeing issues where discarding a prediction (e.g. `editor::Cancel`
while a prediction is being shown) seems to just hide it temporarily.
This is becoming a larger issue with #51842 as we now expect people to
be dismissing predictions in order to insert literal tabs in certain
contexts.
The logic changed in this PR is part of the problem, but the model
generating the same prediction multiple times is also likely
contributing. That will be solved as-needed later.


## Self-Review Checklist

<!-- Check before requesting review: -->
- [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 an issue where dismissing an edit prediction would not fully
discard it, causing it to re-appear
```

## Parents

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

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