Experimental: A container for a related set of markers.
This API is experimental and subject to change on any release.
Create a copy of this layer with markers in the same state and locations.
Destroy this layer.
Determine whether this layer has been destroyed.
Find markers in the layer conforming to the given parameters.
See the documentation for TextBuffer::findMarkers.
Create a marker with the given range.
See the documentation for TextBuffer::markRange
Create a marker with the given position and no tail.
See the documentation for TextBuffer::markPosition
Subscribe to be notified asynchronously whenever markers are created, updated, or destroyed on this layer. Prefer this method for optimal performance when interacting with layers that could contain large numbers of markers.
Subscribers are notified once, asynchronously when any number of changes occur in a given tick of the event loop. You should re-query the layer to determine the state of markers in which you’re interested in. It may be counter-intuitive, but this is much more efficient than subscribing to events on individual markers, which are expensive to deliver.
Argument | Description |
---|---|
|
A Function that will be called with no arguments when changes occur on this layer. |
Return values |
---|
Returns a Disposable. |
Subscribe to be notified synchronously whenever markers are created on this layer. Avoid this method for optimal performance when interacting with layers that could contain large numbers of markers.
You should prefer onDidUpdate when synchronous notifications aren’t absolutely necessary.
Argument | Description |
---|---|
|
A Function that will be called with a Marker whenever a new marker is created. |
Return values |
---|
Returns a Disposable. |
Subscribe to be notified synchronously when this layer is destroyed.
Return values |
---|
Returns a Disposable. |