Skip to content

Commit 8e33541

Browse files
devvaannshabose
authored andcommitted
fix: tab bar disappearing when only one file is added in split view case
1 parent 609ba7b commit 8e33541

File tree

1 file changed

+9
-2
lines changed
  • src/extensionsIntegrated/TabBar

1 file changed

+9
-2
lines changed

src/extensionsIntegrated/TabBar/main.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ define(function (require, exports, module) {
243243
setTimeout(function () {
244244
$(".not-editor").before($tabBar);
245245
WorkspaceManager.recomputeLayout(true);
246+
updateTabs();
246247
}, 0);
247248

248249
} else if ($('.not-editor').length === 2) {
@@ -257,6 +258,7 @@ define(function (require, exports, module) {
257258
$(".not-editor").eq(0).before($tabBar);
258259
$(".not-editor").eq(1).before($tabBar2);
259260
WorkspaceManager.recomputeLayout(true);
261+
updateTabs();
260262
}, 0);
261263
}
262264

@@ -277,9 +279,14 @@ define(function (require, exports, module) {
277279
// In a vertical split, when no files are present in 'second-pane' so the tab bar is hidden.
278280
// Now, when the user adds a file in 'second-pane', the tab bar should be shown but since updateTabs() only,
279281
// updates the tabs, so the tab bar never gets created.
280-
if (Global.firstPaneWorkingSet.length === 1 || Global.secondPaneWorkingSet.length === 1) {
282+
if (Global.firstPaneWorkingSet.length === 1 &&
283+
(!$('#phoenix-tab-bar').length || $('#phoenix-tab-bar').is(':hidden'))) {
284+
createTabBar();
285+
}
286+
287+
if (Global.secondPaneWorkingSet.length === 1 &&
288+
(!$('#phoenix-tab-bar-2').length || $('#phoenix-tab-bar-2').is(':hidden'))) {
281289
createTabBar();
282-
return;
283290
}
284291

285292
const $firstTabBar = $('#phoenix-tab-bar');

0 commit comments

Comments
 (0)