Skip to content

Workspace.setActiveLeaf method

Workspace › setActiveLeaf

Official

Sets the active leaf.

Signature:

setActiveLeaf(leaf: WorkspaceLeaf, params?: SetActiveLeafParams | undefined): void

Parameters:

Parameter Type Description
leaf WorkspaceLeaf The new active leaf.
params? SetActiveLeafParams | undefined Parameter object of whether to set the focus.

Returns: void

Since: 0.16.3

Example:

app.workspace.setActiveLeaf(app.workspace.getLeaf(false), { focus: true });

Official

Sets the active leaf.

Signature:

setActiveLeaf(leaf: WorkspaceLeaf, pushHistory: boolean, focus: boolean): void

Parameters:

Parameter Type Description
leaf WorkspaceLeaf
pushHistory boolean
focus boolean

Returns: void