From b0425e305dffdeb598b53441d8a3d6bf0e8e54ae Mon Sep 17 00:00:00 2001 From: Thorsten Kohnhorst Date: Wed, 25 Mar 2015 16:44:24 +0100 Subject: [PATCH] using uri to detect settings view and changed test --- lib/sublime-tab-bar-view.coffee | 2 +- spec/sublime-tabs-spec.coffee | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/sublime-tab-bar-view.coffee b/lib/sublime-tab-bar-view.coffee index 0a1a954..d771a9d 100644 --- a/lib/sublime-tab-bar-view.coffee +++ b/lib/sublime-tab-bar-view.coffee @@ -31,7 +31,7 @@ class SublimeTabBarView extends TabBarView false addTabForItem: (item, index) -> - if item.activePanelName != "Settings" + if item.uri != "atom://config" for tab in @getTabs() @closeTab(tab) if tab.is('.temp') diff --git a/spec/sublime-tabs-spec.coffee b/spec/sublime-tabs-spec.coffee index bb31216..ed14ae6 100644 --- a/spec/sublime-tabs-spec.coffee +++ b/spec/sublime-tabs-spec.coffee @@ -128,8 +128,9 @@ describe 'SublimeTabBarView', -> expect(tabBar.tabForItem(settingsView)).toExist() expect(tabBar.tabForItem(settingsView)).not.toHaveClass 'temp' - it 'replaces an existing temp tab', -> - expect(tabBar.tabForItem(editor2)).not.toExist() + it 'keeps an existing temp tab', -> + expect(tabBar.tabForItem(editor2)).toExist() + expect(tabBar.tabForItem(editor2)).toHaveClass 'temp' describe 'when opening an image', -> it 'should be temporary', ->