Skip to content

Editor.wordAt method

Editor › wordAt

Official

Get the word at a specific position.

Signature:

wordAt(pos: EditorPosition): EditorRange | null

Parameters:

Parameter Type Description
pos EditorPosition The position to get the word at.

Returns: EditorRange | nullA range object containing the word or null if there is no word at the position.

Since: 0.11.11

Example:

console.log(editor.wordAt({ line: 12, ch: 3 }));