Skip to content

Commit 62ac120

Browse files
committed
fix: tab bar for both panes gets closed when one pane tab bar gets empty
1 parent f379975 commit 62ac120

File tree

1 file changed

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

1 file changed

+11
-5
lines changed

src/extensionsIntegrated/TabBar/main.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,16 @@ define(function (require, exports, module) {
139139
// this populates the working sets
140140
getAllFilesFromWorkingSet();
141141

142-
// make sure there is atleast one file in the first pane working set
142+
// if no files are present in a pane, we want to hide the tab bar for that pane
143+
if(firstPaneWorkingSet.length === 0) {
144+
Helper._hideTabBar($('#phoenix-tab-bar'));
145+
}
146+
147+
if(secondPaneWorkingSet.length === 0) {
148+
Helper._hideTabBar($('#phoenix-tab-bar-2'));
149+
}
150+
151+
// to add tabs one by one to the tab bar
143152
if (firstPaneWorkingSet.length > 0) {
144153
for (let i = 0; i < firstPaneWorkingSet.length; i++) {
145154
// Note: here we add the element to the tab bar directly and not the tab-container
@@ -159,7 +168,7 @@ define(function (require, exports, module) {
159168
* Creates the tab bar and adds it to the DOM
160169
*/
161170
function createTabBar() {
162-
if (!Preference.tabBarEnabled || !EditorManager.getActiveEditor()) {
171+
if (!Preference.tabBarEnabled) {
163172
return;
164173
}
165174

@@ -349,6 +358,3 @@ define(function (require, exports, module) {
349358
handleTabClick();
350359
});
351360
});
352-
353-
354-
// TODO: Bug (when we have two panes and one pane gets empty by closing all files in it, the other pane tab bar also gets removed)

0 commit comments

Comments
 (0)