about summary refs log tree commit diff stats
path: root/lib/ui/tab.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ui/tab.go')
-rw-r--r--lib/ui/tab.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ui/tab.go b/lib/ui/tab.go
index e41e906..32b195c 100644
--- a/lib/ui/tab.go
+++ b/lib/ui/tab.go
@@ -62,13 +62,13 @@ func (tabs *Tabs) Remove(content Drawable) {
 	}
 	/* Force the selected index into the existing range */
 	if tabs.Selected >= len(tabs.Tabs) {
-		tabs.Select(len(tabs.Tabs) - 1)
+		tabs.Select(tabs.Selected - 1)
 	}
 	tabs.TabStrip.Invalidate()
 }
 
 func (tabs *Tabs) Select(index int) {
-	if tabs.Selected >= len(tabs.Tabs) {
+	if index >= len(tabs.Tabs) {
 		panic("Tried to set tab index to a non-existing element")
 	}