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.
Remove all markers from 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.
Argument | Description |
---|---|
|
|
|
A hash of key-value pairs to associate with the marker. There are also reserved property names that have marker-specific meaning. |
|
optional
Boolean Creates the marker in a reversed orientation. (default: false) |
|
optional
String Determines the rules by which changes to the buffer invalidate the marker. (default: ‘overlap’) It can be any of the following strategies, in order of fragility:
|
|
Boolean indicating whether insertions at the start or end of the marked range should be interpreted as happening outside the marker. Defaults to |
Return values |
---|
Returns a Marker. |
Create a marker at with its head at the given position with no tail.
Argument | Description |
---|---|
|
|
|
optional
An Object with the following keys: |
|
optional
String Determines the rules by which changes to the buffer invalidate the marker. (default: ‘overlap’) It can be any of the following strategies, in order of fragility:
|
|
Boolean indicating whether insertions at the start or end of the marked range should be interpreted as happening outside the marker. Defaults to |
Return values |
---|
Returns a Marker. |
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. |