Fix panic trying to go to next of 0 matches (#13233)
Release Notes: - Fixed a panic when going to next search result when there are none
This commit is contained in:
parent
99e4b3a4cf
commit
5ff7c893be
1 changed files with 1 additions and 0 deletions
|
@ -775,6 +775,7 @@ impl BufferSearchBar {
|
||||||
if let Some(matches) = self
|
if let Some(matches) = self
|
||||||
.searchable_items_with_matches
|
.searchable_items_with_matches
|
||||||
.get(&searchable_item.downgrade())
|
.get(&searchable_item.downgrade())
|
||||||
|
.filter(|matches| !matches.is_empty())
|
||||||
{
|
{
|
||||||
let new_match_index = searchable_item
|
let new_match_index = searchable_item
|
||||||
.match_index_for_direction(matches, index, direction, count, cx);
|
.match_index_for_direction(matches, index, direction, count, cx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue