Class CodeMirrorSearchHighlighter

Helper class to highlight texts in a code mirror editor.

Highlighted texts (aka matches) must be provided through the matches attributes.

NOTES:

  • to retain the selection visibility drawSelection extension is needed.
  • highlighting starts from the cursor (if editor is focused and from is set to 'auto', cursor moved, or from argument is set to 'selection' or 'selection-start'), or from last "current" match otherwise.
  • currentIndex is the (readonly) source of truth for the current match.

Constructors

Properties

_cm: null | CodeMirrorEditor
_current: null | ISearchMatch = null
_currentIndex: null | number
_currentMark: Decoration
_domEventHandlers: Extension
_highlightEffect: StateEffectType<IEffectValue>
_highlightField: StateField<DecorationSet>
_highlightMark: Decoration
_matches: ISearchMatch[]
_protectSelection: boolean

Accessors

Methods