# diagnostics: Prefer activating diagnostic under cursor \(\#52957\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 3bb2f2a61d767f2bf50a1cf6d5f2898b4cece85b

Requested commit: 3bb2f2a61d767f2bf50a1cf6d5f2898b4cece85b

Commit: 3bb2f2a61d767f2bf50a1cf6d5f2898b4cece85b

Tree: 336c5533bc60953a274432b4fc8ee44d9c2a0471

Author: nullstalgia

Committer: GitHub

## Message

```
diagnostics: Prefer activating diagnostic under cursor (#52957)

Update the behavior of both `editor: go to diagnostic` and `editor: go
to previous diagnostic` in order to ensure that, if there's a diagnostic
under the user's cursor that isn't active, it is first activated, with a
subsequent call jumping to the next or previous diagnostic,
respectively.

These changes also update how diagnostic activation handles the
situation when the global diagnostic renderer is not registered, as we
used to not update the active diagnostic group in that situation.
However, we now rely on it to determine whether the user's cursor is
already in the active diagnostic, with some tests now failing, so we now
default to an empty set of blocks for the active diagnostic group when
no global renderer is registered.

Release Notes:

- Update both `editor: go to diagnostic` and `editor: go to previous
diagnostic` to prefer activating the diagnostic under the cursor before
jumping to the next or previous diagnostic, respectively

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
```

## Parents

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

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