Skip to content

Commit

Permalink
Fix shift+tab on first item in fuzzy search dialog. Fixes #182
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jun 24, 2020
1 parent 5c44583 commit 48537f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui/fuzzy-search-modal.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ func (fs *FuzzySearchModal) OnKeyEvent(event mauview.KeyEvent) bool {
case tcell.KeyBacktab:
if len(highlights) > 0 {
fs.selected = (fs.selected - 1) % len(fs.matches)
if fs.selected < 0 {
fs.selected += len(fs.matches)
}
fs.results.Highlight(strconv.Itoa(fs.matches[fs.selected].OriginalIndex))
fs.results.ScrollToHighlight()
}
Expand Down

0 comments on commit 48537f9

Please sign in to comment.