Skip to content

Editor.setSelection method

Editor › setSelection

Official

Set the selection.

Signature:

setSelection(anchor: EditorPosition, head?: EditorPosition | undefined): void

Parameters:

ParameterTypeDescription
anchorEditorPositionThe start selection position.
head?EditorPosition | undefinedThe end selection position.

Returns: void

Since: 0.11.11

Example:

editor.setSelection({ line: 12, ch: 3 }, { line: 23, ch: 4 });