From 31244686fe4e6fc613de04b85497b2b0285610df Mon Sep 17 00:00:00 2001 From: Thomas Brouard Date: Tue, 1 Nov 2016 16:09:43 +0100 Subject: [PATCH] Don't change active tab if closed tab wasn't active --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index cb337bf..dcde6f8 100644 --- a/index.js +++ b/index.js @@ -222,7 +222,11 @@ class Tab extends EventEmitter { tabGroup.viewContainer.removeChild(this.webview); TabGroupPrivate.removeTab.bind(tabGroup)(this, true); this.emit("close", this); - TabGroupPrivate.activateRecentTab.bind(tabGroup)(); + + let activeTab = this.tabGroup.getActiveTab(); + if (activeTab.id === this.id) { + TabGroupPrivate.activateRecentTab.bind(tabGroup)(); + } } }