# Make buffer search aware of search direction \(\#24974\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 229e8538741c3ce5b8672b710aa6030c380de7ab

Requested commit: 229e8538741c3ce5b8672b710aa6030c380de7ab

Commit: 229e8538741c3ce5b8672b710aa6030c380de7ab

Tree: adb3b87150702c72d706c22109fd035a760c069b

Author: Nico Lehmann

Committer: GitHub

## Message

```
Make buffer search aware of search direction (#24974)

This solves a couple of issues with Vim search by making the search
buffer and `SearchableItem` aware of the direction of the search. If
`SearchOptions::BACKWARDS` is set, all operations will be reversed. By
making `SearchableItem` aware of the direction, the correct active match
can be selected when searching backward.

Fixes #22506. This PR does not fix the last problem in that issue, but
that one is also tracked in #8049.

Release Notes:

- Fixes incorrect behavior of backward search in Vim mode
```

## Parents

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

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