Skip to content

Commit 48beab5

Browse files
committed
fix: tab bar not appearing when only a placeholder tab is present
1 parent 1786787 commit 48beab5

File tree

1 file changed

+7
-11
lines changed
  • src/extensionsIntegrated/TabBar

1 file changed

+7
-11
lines changed

src/extensionsIntegrated/TabBar/main.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,6 @@ define(function (require, exports, module) {
221221
// Get all files from the working set. refer to `global.js`
222222
getAllFilesFromWorkingSet();
223223

224-
// When there is only one file, we enforce the creation of the tab bar
225-
// this is done because, given the situation:
226-
// In a vertical split, when no files are present in 'second-pane' so the tab bar is hidden.
227-
// Now, when the user adds a file in 'second-pane', the tab bar should be shown but since updateTabs() only,
228-
// updates the tabs, so the tab bar never gets created.
229-
if (Global.firstPaneWorkingSet.length === 1 &&
230-
(!$('#phoenix-tab-bar').length || $('#phoenix-tab-bar').is(':hidden'))) {
231-
createTabBar();
232-
}
233-
234224
// Check for active files not in working set in any pane
235225
const activePane = MainViewManager.getActivePaneId();
236226
const firstPaneFile = MainViewManager.getCurrentlyViewedFile("first-pane");
@@ -260,7 +250,13 @@ define(function (require, exports, module) {
260250
};
261251
}
262252

263-
if (Global.secondPaneWorkingSet.length === 1 &&
253+
// create the tab bar if there's a placeholder or a file in the working set
254+
if ((Global.firstPaneWorkingSet.length > 0 || firstPanePlaceholder) &&
255+
(!$('#phoenix-tab-bar').length || $('#phoenix-tab-bar').is(':hidden'))) {
256+
createTabBar();
257+
}
258+
259+
if ((Global.secondPaneWorkingSet.length > 0 || secondPanePlaceholder) &&
264260
(!$('#phoenix-tab-bar-2').length || $('#phoenix-tab-bar-2').is(':hidden'))) {
265261
createTabBar();
266262
}

0 commit comments

Comments
 (0)