From 2542c65af2c24c94d70e8ab51cc590fe8fc3bd28 Mon Sep 17 00:00:00 2001 From: Jeffas Date: Thu, 10 Oct 2019 13:09:45 +0100 Subject: [PATCH] Fix pushing invalid tabs to history A tab can now only be pushed onto the history if it is a selectable tab. --- lib/ui/tab.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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()