Represents a decoration that follows a TextEditorMarker. A decoration is basically a visual representation of a marker. It allows you to add CSS classes to line numbers in the gutter, lines, and add selection-line regions around marked ranges of text.
Decoration objects are not meant to be created directly, but created with TextEditor::decorateMarker. eg.
range = editor.getSelectedBufferRange() # any range you like
marker = editor.markBufferRange(range)
decoration = editor.decorateMarker(marker, {type: 'line', class: 'my-line-class'})
Best practice for destroying the decoration is by destroying the TextEditorMarker.
marker.destroy()
You should only use Decoration::destroy when you still need or do not own the marker.
Destroy this marker.
If you own the marker, you should use TextEditorMarker::destroy which will destroy this decoration.
When the Decoration is updated via Decoration::update.
Argument | Description |
---|---|
|
|
|
|
|
Object the old parameters the decoration used to have |
|
Object the new parameters the decoration now has |
Return values |
---|
Returns a Disposable on which |
Invoke the given callback when the Decoration is destroyed
Argument | Description |
---|---|
|
Return values |
---|
Returns a Disposable on which |
An id unique across all Decoration objects
Update the marker with new Properties. Allows you to change the decoration’s class.
Argument | Description |
---|---|
|
Object eg. |