From 0ce1d42bda406a1d7c83df462206f435a841a809 Mon Sep 17 00:00:00 2001 From: Jeffas Date: Mon, 16 Sep 2019 17:39:03 +0100 Subject: 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. --- lib/ui/tab.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/ui/tab.go') 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() } -- cgit 1.4.1-2-gfad0