diff options
author | Jeffas <dev@jeffas.io> | 2019-10-10 13:09:45 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-10-14 10:38:02 -0400 |
commit | 2542c65af2c24c94d70e8ab51cc590fe8fc3bd28 (patch) | |
tree | ba09364540eefc2f9b3646259a1353bc63feb436 /lib | |
parent | f1b365dfc30b7253f3baea270ebcc8d1fb754db9 (diff) | |
download | aerc-2542c65af2c24c94d70e8ab51cc590fe8fc3bd28.tar.gz |
Fix pushing invalid tabs to history
A tab can now only be pushed onto the history if it is a selectable tab.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ui/tab.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ui/tab.go b/lib/ui/tab.go index 9c19cd7b..ef9fcd83 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() |