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.
This commit is contained in:
parent
6db4ab381c
commit
ed7c55a04e
2 changed files with 13 additions and 11 deletions
|
@ -987,6 +987,16 @@ impl BufferSearchBar {
|
|||
cx.notify();
|
||||
}
|
||||
|
||||
pub fn clear_search_within_ranges(
|
||||
&mut self,
|
||||
search_options: SearchOptions,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
self.search_options = search_options;
|
||||
self.adjust_query_regex_language(cx);
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
fn select_next_match(
|
||||
&mut self,
|
||||
_: &SelectNextMatch,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue