Skip to content

Commit

Permalink
fix step back prev in buffer searcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Kl4rry committed Jul 15, 2024
1 parent 47acca7 commit bdb0df9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/ferrite-core/src/buffer/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ impl BufferSearcher {
} else {
if self.match_index == 0 {
self.match_index = guard.0.len().saturating_sub(1);
} else {
self.match_index = self.match_index.saturating_sub(1);
}
self.match_index -= 1;
}
guard.0.get(self.match_index).copied()
}
Expand Down

0 comments on commit bdb0df9

Please sign in to comment.