# vim: Only focus when associated editor is also focused \(\#41487\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f3a5ebc31501c4f46c5fe0478759ce21b6249c13

Requested commit: f3a5ebc31501c4f46c5fe0478759ce21b6249c13

Commit: f3a5ebc31501c4f46c5fe0478759ce21b6249c13

Tree: df95e7d83fc34b51bc95f9d925e8583710c04a0d

Author: Dino

Committer: GitHub

## Message

```
vim: Only focus when associated editor is also focused (#41487)

Update `Vim::activate` to ensure that the `Vim.focused` method is only
called if the associated editor is also focused.

This ensures that the `VimEvent::Focused` event is only emitted when the
editor is actually focused, preventing a bug where, after starting Zed,
Vim's mode indicator would show that the mode was `Insert` even though
it was in `Normal` mode in the main editor.

Closes #41353 

Release Notes:

- Fixed vim's mode being shown as `Inserted` right after opening Zed

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
```

## Parents

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

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