addPointerListener
addPointerListener<
T>(editor,type,listener,lineFilter?): () =>void
Defined in: extensions/hover.ts:34
The editor lines have pointer-events: none which means that all pointer and mouse
events are captured by the textarea element itself. This utlity can be used to add
a subset of pointer and mouse listeners that will be called with the token the pointer
is on. If the pointer isn’t on a token, then the line itself will be passed to the
listener.
Type Parameters
Section titled “Type Parameters”T extends AllowedEditorPointerEvents
Parameters
Section titled “Parameters”editor
Section titled “editor”Editor to add the listener to.
T
Event to listen to.
listener
Section titled “listener”(e, target) => any
Listener called with the event and target token.
lineFilter?
Section titled “lineFilter?”(line, lineNumber, e) => boolean
If a line won’t have any tokens the listener is interested in, then this filter can return false to skip computing the target token at the cursor’s position for a performance boost. If ommitted, the listener will be called for all lines.
Returns
Section titled “Returns”Cleanup function to remove the listener.
():
void
Returns
Section titled “Returns”void