Editor.setCursor method
Editor › setCursor
Official
Set the cursor position.Signature:
setCursor(pos: number | EditorPosition, ch?: number | undefined): voidParameters:
| Parameter | Type | Description |
|---|---|---|
| pos | number | EditorPosition | The position to set the cursor to, or a line number (0-based). |
| ch? | number | undefined | The character index (0-based), if pos is a line number. |
Returns: void
Since: 0.11.11
Example:
editor.setCursor({ line: 12, ch: 3 });editor.setCursor(12, 3);