Merge pull request #748 from zed-industries/fix-outline-panic
Don't assume there are always matches in outline view
This commit is contained in:
commit
7c21b61ad9
1 changed files with 2 additions and 2 deletions
|
@ -277,8 +277,8 @@ impl OutlineView {
|
||||||
(ix, depth, distance_to_closest_endpoint)
|
(ix, depth, distance_to_closest_endpoint)
|
||||||
})
|
})
|
||||||
.max_by_key(|(_, depth, distance)| (*depth, Reverse(*distance)))
|
.max_by_key(|(_, depth, distance)| (*depth, Reverse(*distance)))
|
||||||
.unwrap()
|
.map(|(ix, _, _)| ix)
|
||||||
.0;
|
.unwrap_or(0);
|
||||||
navigate_to_selected_index = false;
|
navigate_to_selected_index = false;
|
||||||
} else {
|
} else {
|
||||||
self.matches = smol::block_on(self.outline.search(&query, cx.background().clone()));
|
self.matches = smol::block_on(self.outline.search(&query, cx.background().clone()));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue