Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

buffer/replace: Advance match index on each replace. (#2992)

Piotr Osiewicz4525509804f8
diff --git a/crates/search/src/buffer_search.rs b/crates/search/src/buffer_search.rs
index 5fc0854b811..eb15146314a 100644
--- a/crates/search/src/buffer_search.rs
+++ b/crates/search/src/buffer_search.rs
@@ -925,6 +925,7 @@ impl BufferSearchBar {
Some(self.replacement(cx)).filter(|rep| !rep.is_empty()),
);
searchable_item.replace(&matches[active_index], &query, cx);
+ self.select_next_match(&SelectNextMatch, cx);
}
self.focus_editor(&FocusEditor, cx);