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.

Fix panic trying to go to next of 0 matches (#13233)

Conrad Irwin5ff7c893be29
diff --git a/crates/search/src/buffer_search.rs b/crates/search/src/buffer_search.rs
index a6a81375bee..2dd2b98b64b 100644
--- a/crates/search/src/buffer_search.rs
+++ b/crates/search/src/buffer_search.rs
@@ -775,6 +775,7 @@ impl BufferSearchBar {
if let Some(matches) = self
.searchable_items_with_matches
.get(&searchable_item.downgrade())
+ .filter(|matches| !matches.is_empty())
{
let new_match_index = searchable_item
.match_index_for_direction(matches, index, direction, count, cx);