getDocumentPosition
getDocumentPosition(
editor): [number,number,number]
Defined in: utils/index.ts:237
Gets the position of the cursor in the document. It returns a tuple with three numbers:
- The line number of the cursor
- The 1-based column of the cursor
- Number of characters selected
Parameters
Section titled “Parameters”editor
Section titled “editor”Returns
Section titled “Returns”[number, number, number]
Example
Section titled “Example”const [line, col, selected] = getDocumentPosition(editor)