fix bug where searching through view got stuck if you went over the upper bound

This commit is contained in:
Jesse Duffield 2021-04-05 00:53:34 +10:00
parent b6cc1c9492
commit 952c62df37
2 changed files with 5 additions and 5 deletions

View file

@ -170,7 +170,7 @@ func (v *View) gotoNextMatch() error {
if len(v.searcher.searchPositions) == 0 {
return nil
}
if v.searcher.currentSearchIndex == len(v.searcher.searchPositions)-1 {
if v.searcher.currentSearchIndex >= len(v.searcher.searchPositions)-1 {
v.searcher.currentSearchIndex = 0
} else {
v.searcher.currentSearchIndex++