Skip to content

Editor.addHighlights method

Editor › addHighlights

Unofficial

Make ranges of text highlighted within the editor given specified class (style).

Signature:

addHighlights(ranges: EditorRange[], style: "is-flashing" | "obsidian-search-match-highlight", removePrevious: boolean, range?: EditorSelection | undefined): void

Parameters:

Parameter Type Description
ranges EditorRange[] The ranges to highlight.
style "is-flashing" | "obsidian-search-match-highlight" The highlight style class.
removePrevious boolean Whether to remove previous highlights.
range? EditorSelection | undefined The editor selection range.

Returns: void