« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/ui.js b/ui.js
index 368c8ea..a7ad672 100644
--- a/ui.js
+++ b/ui.js
@@ -3271,11 +3271,17 @@ class Tabber extends FocusElement {
 
   nextTab() {
     this.currentElementIndex++
+    if (this.currentElementIndex >= this.tabberElements.length) {
+      this.currentElementIndex = 0
+    }
     this.updateVisibleElement()
   }
 
   previousTab() {
     this.currentElementIndex--
+    if (this.currentElementIndex < 0) {
+      this.currentElementIndex = this.tabberElements.length - 1
+    }
     this.updateVisibleElement()
   }