Skip to content

Workspace.setActiveLeaf method

Workspace › setActiveLeaf

Official

Sets the active leaf.

Signature:

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

Parameters:

ParameterTypeDescription
leafWorkspaceLeafThe new active leaf.
params?SetActiveLeafParams | undefinedParameter 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:

ParameterTypeDescription
leafWorkspaceLeaf
pushHistoryboolean
focusboolean

Returns: void