Highlight

A highlight is a line number that is highlighted across the entire editor.

Create a new highlight with editor.createHighlight() (see: createHighlight}) and delete it with highlight.delete().

Assign a css class to the highlight with highlight.cssClass (see: cssClass) to determine things like what background color you'd like the highlight to have.

Set the line number of the highlight with highlight.lineNumber (see: lineNumber). This will move the highlight to the new line number.

Set the visibility of the highlight with highlight.visible (see: visible). This will show or hide the highlight.

Example

const highlight = editor.createHighlight();
highlight.cssClass = 'highlight';
highlight.lineNumber = 1;
highlight.visible = true;

Example CSS:

.highlight {
/* semi-transparent yellow highlight * /
background-color: #b5890066;
}

Hierarchy

  • Highlight

Accessors

Methods

Accessors

Methods

Generated using TypeDoc