add simple support for wrapscan

This commit is contained in:
hans
2024-06-25 17:34:50 +08:00
parent 88000eb7e2
commit df70d5fadf

View File

@@ -777,6 +777,12 @@ impl BufferSearchBar {
.get(&searchable_item.downgrade())
.filter(|matches| !matches.is_empty())
{
if matches.len() == index + 1 && direction == Direction::Next {
return;
}
if index == 0 && direction == Direction::Prev {
return;
}
let new_match_index = searchable_item
.match_index_for_direction(matches, index, direction, count, cx);