# vim: Reset search range after substitute \(\#28403\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ed7c55a04ead9e3d2edd509406e66404601d68dd

Requested commit: ed7c55a04ead9e3d2edd509406e66404601d68dd

Commit: ed7c55a04ead9e3d2edd509406e66404601d68dd

Tree: 2f6b9d984840ad28702db92f4917ebf0b618107a

Author: Dino

Committer: GitHub

## Message

```
vim: Reset search range after substitute (#28403)

Update the `Vim::replace_command` method so as to reset the range in the
`BufferSearchBar` after running the replacement in order to fix the
issue where the number of matches in the search bar would be incorrect
after the replacement was done, as it would only take into consideration
the range in which the replacement happened, instead of the whole
buffer.

In order to get this working a new
`BufferSearchBar::clear_search_within_ranges` method is introduced in
these changes.

Release Notes:

- Fixed the number of matches displayed in the search bar after running
vim's substitute command.
```

## Parents

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

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