Skip to content

Commit

Permalink
Automatically exit the tabbed layout when only a single tab remains
Browse files Browse the repository at this point in the history
resolves #341
  • Loading branch information
AndrewKvalheim authored and jmmaranan committed May 31, 2024
1 parent 05845ef commit f754af0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/extension/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,17 @@ export class Tree extends Node {
if (!this.extWm.floatingWindow(node)) cleanUpParent(existParent);
}

// If only a single tab remains, exit tabbed layout
if (
parentNode.nodeType === NODE_TYPES.CON &&
parentNode.layout === LAYOUT_TYPES.TABBED &&
parentNode.childNodes.length === 1
) {
parentNode.layout = this.extWm.determineSplitLayout();
this.resetSiblingPercent(parentNode);
parentNode.lastTabFocus = null;
}

if (node === this.attachNode) {
this.attachNode = null;
} else {
Expand Down

0 comments on commit f754af0

Please sign in to comment.