Skip to content

Workspace.getLeaf method

Workspace › getLeaf

Official

Creates a new leaf in a leaf adjacent to the currently active leaf. If direction is 'vertical', the leaf will appear to the right. If direction is 'horizontal', the leaf will appear below the current leaf.

Signature:

getLeaf(newLeaf?: "split" | undefined, direction?: SplitDirection | undefined): WorkspaceLeaf

Parameters:

Parameter Type Description
newLeaf? "split" | undefined *(Optional)*
direction? SplitDirection | undefined *(Optional)*

Returns: WorkspaceLeaf

Since: 0.16.0


Official

If newLeaf is false (or not set) then an existing leaf which can be navigated is returned, or a new leaf will be created if there was no leaf available.

If newLeaf is 'tab' or true then a new leaf will be created in the preferred location within the root split and returned.

If newLeaf is 'split' then a new leaf will be created adjacent to the currently active leaf.

If newLeaf is 'window' then a popout window will be created with a new leaf inside.

Signature:

getLeaf(newLeaf?: boolean | PaneType | undefined): WorkspaceLeaf

Parameters:

Parameter Type Description
newLeaf? boolean | PaneType | undefined *(Optional)*

Returns: WorkspaceLeaf

Since: 0.16.0