Skip to content

CodeMirrorEditor.setSelection method

CodeMirrorEditor › setSelection

Unofficial

Set the selection to the given anchor and head positions.

Signature:

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

Parameters:

ParameterTypeDescription
anchorEditorPositionThe anchor position of the selection.
headEditorPositionThe head position of the selection.
options?SetSelectionOptions | undefinedThe selection options.

Returns: void