Skip to content

Editor.getCursor method

Editor › getCursor

Official

Get the cursor position.

Signature:

getCursor(string?: "anchor" | "from" | "head" | "to" | undefined): EditorPosition

Parameters:

Parameter Type Description
string? "anchor" | "from" | "head" | "to" | undefined The type of cursor to get.

Returns: EditorPositionThe cursor position.

Since: 0.11.11

Example:

console.log(editor.getCursor('from'));