Skip to content

Editor.getCursor method

Editor › getCursor

Official

Get the cursor position.

Signature:

getCursor($string?: 'anchor' | 'from' | 'head' | 'to'): EditorPosition

Parameters:

ParameterTypeDescription
$string?'anchor' | 'from' | 'head' | 'to'*(Optional)*

Returns: EditorPosition — The cursor position.

Since: 0.11.11

Example:

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