Editor you want to search in.
CSS selector for the tokens you want to search for.
How far to the left of the token the position can be. Defaults to 0.
How far to the right of the token the position can be. Defaults to marginLeft
.
Position to search in. Defaults to selectionStart
.
A span element if one's found or undefined if not.
This will return a string token if the cursor is at least 1 character inside a string token
getClosestToken(editor, '.string', -1)
Generated using TypeDoc
Searches a full line for a token that matches a selector and contains
position
within the specified margins. Tokens are searched in reverse document order which means children are searched before their parents.