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.

Hierarchy

  • CodeMirrorSearchHighlighter

Constructors

Properties

_cm: any
_current: any
_currentIndex: any
_currentMark: any
_domEventHandlers: any
_findNext: any
_highlightCurrentMatch: any
_highlightEffect: any
_highlightField: any
_highlightMark: any
_matches: any
_protectSelection: any
_refresh: any
_selectCurrentMatch: any

Accessors

  • get currentIndex(): number
  • The current index of the selected match.

    Returns number

  • get matches(): ISearchMatch[]
  • The list of matches

    Returns ISearchMatch[]

  • set matches(v): void
  • Parameters

    Returns void

  • get protectSelection(): boolean
  • Whether the cursor/selection should not be modified.

    Returns boolean

  • set protectSelection(v): void
  • Parameters

    • v: boolean

    Returns void

Methods

  • Clear all highlighted matches

    Returns void

  • Clear the highlighted matches.

    Returns Promise<void>

  • Set the editor

    Parameters

    Returns void

Generated using TypeDoc