Skip to content

Workspace.duplicateLeaf method

Workspace › duplicateLeaf

Official

Duplicate a leaf.

Signature:

duplicateLeaf(leaf: WorkspaceLeaf, direction?: SplitDirection | undefined): Promise<WorkspaceLeaf>

Parameters:

ParameterTypeDescription
leafWorkspaceLeafThe leaf.
direction?SplitDirection | undefinedThe direction to split in.

Returns: Promise<WorkspaceLeaf>

Since: 0.13.8


Official

Duplicate a leaf.

Signature:

duplicateLeaf(leaf: WorkspaceLeaf, leafType: boolean | PaneType, direction?: SplitDirection | undefined): Promise<WorkspaceLeaf>

Parameters:

ParameterTypeDescription
leafWorkspaceLeafThe leaf.
leafTypeboolean | PaneTypeWhere to open the duplicate. See {@link Workspace.getLeaf}.
direction?SplitDirection | undefinedThe direction to split in, if leafType is 'split'.

Returns: Promise<WorkspaceLeaf>

Since: 1.1.0