Skip to content

Commit

Permalink
fix cursor > len(filtered) on reload
Browse files Browse the repository at this point in the history
  • Loading branch information
pomdtr committed Nov 16, 2023
1 parent d53768f commit 0a1e84f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/tui/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ func (f *Filter) FilterItems(query string) {
}

f.filtered = filtered

if f.cursor >= len(f.filtered) {
f.cursor = len(f.filtered) - 1
}
}

func (f *Filter) Select(id string) {
Expand Down

0 comments on commit 0a1e84f

Please sign in to comment.