# diagnostics: Fix losing focus when activating from diagnostics view \(\#25517\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ed6bf7f161c6af6e10354faacb8b643a55c80b27

Requested commit: ed6bf7f161c6af6e10354faacb8b643a55c80b27

Commit: ed6bf7f161c6af6e10354faacb8b643a55c80b27

Tree: 0028ce560fbac5153f5f1c49b69a2cc8690f5f3f

Author: brian tan

Committer: GitHub

## Message

```
diagnostics: Fix losing focus when activating from diagnostics view (#25517)

Closes #25509

Changes:
- If active item is already diagnostics, don't try to focus it again.

Instead of not focusing, should it just not activate instead? Something
like:

            if !workspace
                .active_item(cx)
                .map(|item| item.item_id() == existing.item_id())
                .unwrap_or(false)
            {
workspace.activate_item(&existing, true, true, window, cx);
            }


Release Notes:

- N/A
```

## Parents

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

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