aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2020-06-24 22:47:42 +0300
committerTulir Asokan <tulir@maunium.net>2020-06-24 22:47:42 +0300
commit48537f98ce54e63d8df3d67f73372edf735b217f (patch)
tree8a964ce00f30d83391442f8eda3fa0143f60e06c /ui
parent5c4458384a78f912f0a7375a59b3adc781ce8364 (diff)
Fix shift+tab on first item in fuzzy search dialog. Fixes #182
Diffstat (limited to 'ui')
-rw-r--r--ui/fuzzy-search-modal.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/fuzzy-search-modal.go b/ui/fuzzy-search-modal.go
index 5540760..30a9a92 100644
--- a/ui/fuzzy-search-modal.go
+++ b/ui/fuzzy-search-modal.go
@@ -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()
}