# editor: Respect search case sensitivity when selecting occurrences \(\#42121\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 97100ce52f507695dd21902285a1b9279a455cad

Requested commit: 97100ce52f507695dd21902285a1b9279a455cad

Commit: 97100ce52f507695dd21902285a1b9279a455cad

Tree: fd2b3253ef5f2c0e11ca1592b7001ebfae05d286

Author: Dino

Committer: GitHub

## Message

```
editor: Respect search case sensitivity when selecting occurrences (#42121)

Update how the editor's `select_*` methods work in order to respect the
`search.case_sensitive` setting, or to be overriden by the
`BufferSearchBar` search options.

- Update both the `SearchableItem` and `SearchableItemHandle` traits
  with a new `set_search_is_case_sensitive` method that allows callers
  to set the case sensitivity of the search
- Update the `BufferSearchBar` to leverage
  `SearchableItemHandle.set_search_is_case_sensitive` in order to sync
  its case sensitivity options with the searchable item
- Update the implementation of the `SearchableItem` trait for `Editor`
  so as to store the argument provided to the
  `set_search_is_case_sensitive` method
- Update the way search queries are built by `Editor` so as to rely on
  `SearchableItem.set_search_is_case_sensitive` argument, if not `None`,
  or default to the editor's `search.case_sensitive` settings

Closes #41070 

Release Notes:

- Improved the "Select Next Occurrence", "Select Previous Occurrence"
and "Select All Occurrences" actions in order to respect the case
sensitivity search settings

---------

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

## Parents

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

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