# diagnostics: Live update diagnostics view on edits while focused \(\#41829\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 73366bef6267bcab288e24102df8071ad9d4bb77

Requested commit: 73366bef6267bcab288e24102df8071ad9d4bb77

Commit: 73366bef6267bcab288e24102df8071ad9d4bb77

Tree: 61976041f37be5f4d1b22e3cb08ac109e7cbf831

Author: Lukas Wirth

Committer: GitHub

## Message

```
diagnostics: Live update diagnostics view on edits while focused (#41829)

Prior we were only updating the diagnostics pane when it is either
unfocued, saved or when a disk based diagnostic run finishes (aka cargo
check). The reason for this is simple, we do not want to take away the
excerpt under the users cursor while they are typing if they manage to
fix the diagnostic. Additionally we need to prevent dropping the changed
buffer before it is saved.

Delaying updates was a simple way to work around these kind of issues,
but comes at a huge annoyance that the diagnostics pane is not actually
reflecting the current state of the world but some snapshot of it
instead making it less than ideal to work within it for languages that
do not leverage disk based diagnostics (that is not rust-analyzer, and
even for rust-analyzer its annoying).

This PR changes this. We now always live update the view but take care
to retain unsaved buffers as well as buffers that contain a cursor in
them (as well as some other "checkpoint" properties).

Release Notes:

- Improved diagnostics pane to live update when editing within its
editor
```

## Parents

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

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