summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/ui/tab.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ui/tab.go b/lib/ui/tab.go
index 9c19cd7..ef9fcd8 100644
--- a/lib/ui/tab.go
+++ b/lib/ui/tab.go
@@ -107,7 +107,10 @@ func (tabs *Tabs) Select(index int) {
 	}
 
 	if tabs.Selected != index {
-		tabs.pushHistory(tabs.Selected)
+		// only push valid tabs onto the history
+		if tabs.Selected < len(tabs.Tabs) {
+			tabs.pushHistory(tabs.Selected)
+		}
 		tabs.Selected = index
 		tabs.TabStrip.Invalidate()
 		tabs.TabContent.Invalidate()