Editor.getCursor method
Editor › getCursor
Official
Get the cursor position.Signature:
getCursor(string?: "anchor" | "from" | "head" | "to" | undefined): EditorPositionParameters:
| Parameter | Type | Description |
|---|---|---|
| string? | "anchor" | "from" | "head" | "to" | undefined | The type of cursor to get. |
Returns: EditorPosition — The cursor position.
Since: 0.11.11
Example:
console.log(editor.getCursor('from'));