# Fix Visual mode flip on project search \(\#44284\) · gitcafe/zed

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

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

Visibility: public

Requested revision: d42fe0bba45be15049270fffc9d1a38dce07b2fc

Requested commit: d42fe0bba45be15049270fffc9d1a38dce07b2fc

Commit: d42fe0bba45be15049270fffc9d1a38dce07b2fc

Tree: 08aad6bbf4f17be120a256e3317ff7172c9d355b

Author: MostlyK

Committer: GitHub

## Message

```
Fix Visual mode flip on project search  (#44284)

Previously, when project search results first appeared, vim would
incorrectly switch to Visual mode. This happened because vim settings
(including `collapse_matches`) weren't synced to an editor until it
received focus. Since the results editor wasn't focused when the first
match was selected, the selection wasn't collapsed, causing vim to
interpret it as a visual selection.

Now vim settings are synced immediately when vim activates on an editor,
ensuring `collapse_matches` is set before any selections are made.

Closes #43878

Release Notes:

- Fixed vim mode incorrectly switching to Visual mode on first project
search

---------

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

## Parents

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

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