# text_finder: Highlight the query as a regex when the regex filter is on \(\#61128\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 803467f37f8f2537307406a4d40e97a20f47cd39

Requested commit: 803467f37f8f2537307406a4d40e97a20f47cd39

Commit: 803467f37f8f2537307406a4d40e97a20f47cd39

Tree: 96425119f6424460ba36cf7cf989ba77a97c54c7

Author: Apoorva Verma

Committer: GitHub

## Message

```
text_finder: Highlight the query as a regex when the regex filter is on (#61128)

the buffer search and project search bars both already load the `regex`
language and put it on their query buffer when the regex filter is on.
the text finder never got that, so a regex you type in there is just
plain text.

did the same thing here. the only slightly annoying part was that the
picker's head editor is `pub(crate)`, so text_finder couldn't get at it.
added a small `query_editor()` accessor to `Picker` for that.
`adjust_query_regex_language` mirrors the two existing ones.

test asserts the query buffer's language is regex with the filter on,
and gone once it's off.

Closes #59945.

Release Notes:

- Improved the text finder by highlighting the query as a regex when the
regex filter is on

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
```

## Parents

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

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