# Fix buffer search invalid regexp indicator \(\#7795\) · gitcafe/zed

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

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

Visibility: public

Requested revision: aa319ccfd052b71e791a03afbf73f8bf586b760e

Requested commit: aa319ccfd052b71e791a03afbf73f8bf586b760e

Commit: aa319ccfd052b71e791a03afbf73f8bf586b760e

Tree: 9c769e082940bd1c4245af7407cc59cf1598d635

Author: Andrew Lygin

Committer: GitHub

## Message

```
Fix buffer search invalid regexp indicator (#7795)

This PR fixes the issue with invalid regexp highlighting (red border)
when switching to the simple text searching mode (#7658).

Implementation details:

- `update_matches()` always relied on the caller to reset the
`query_contains_error` flag, which wasn't always the case. Now, it
resets the flag itself.

Release Notes:

- Fix issue with switching between invalid regexp and simple text buffer
search (#7658).

How it works now:


https://github.com/zed-industries/zed/assets/2101250/ac868a5d-5e2f-49a0-90fc-00e62a1d5ee8
```

## Parents

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

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