Fix pushing invalid tabs to history

A tab can now only be pushed onto the history if it is a selectable tab.
This commit is contained in:
Jeffas 2019-10-10 13:09:45 +01:00 committed by Drew DeVault
parent f1b365dfc3
commit 2542c65af2
1 changed files with 4 additions and 1 deletions

View File

@ -107,7 +107,10 @@ func (tabs *Tabs) Select(index int) {
} }
if tabs.Selected != index { 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.Selected = index
tabs.TabStrip.Invalidate() tabs.TabStrip.Invalidate()
tabs.TabContent.Invalidate() tabs.TabContent.Invalidate()