about summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorJeffas <dev@jeffas.io>2019-09-16 17:39:03 +0100
committerDrew DeVault <sir@cmpwn.com>2019-09-18 19:20:49 -0400
commit0ce1d42bda406a1d7c83df462206f435a841a809 (patch)
tree97f053d77c16459c52cfb18370136c2ed7d1c90e /lib
parent956f1366a538f4cbd0f300083871196c4c759d44 (diff)
downloadaerc-0ce1d42bda406a1d7c83df462206f435a841a809.tar.gz
Focus new tab after remove
After removing a tab we should focus the newly selected tab if it is
Interactive. This ensures things like the terminal get drawn properly.
Diffstat (limited to 'lib')
-rw-r--r--lib/ui/tab.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ui/tab.go b/lib/ui/tab.go
index 1fd2b80..9c19cd7 100644
--- a/lib/ui/tab.go
+++ b/lib/ui/tab.go
@@ -77,6 +77,10 @@ func (tabs *Tabs) Remove(content Drawable) {
 	index, ok := tabs.popHistory()
 	if ok {
 		tabs.Select(index)
+		interactive, ok := tabs.Tabs[tabs.Selected].Content.(Interactive)
+		if ok {
+			interactive.Focus(true)
+		}
 	}
 	tabs.TabStrip.Invalidate()
 }