Finds all lines matching a search term in the current [[Document Document]] and displays them instead of the original Document. Keeps track of the mapping between the occur doc and the original doc.

Hierarchy (view full)

Constructors

Properties

$options: Partial<SearchOptions>
$originalSession: EditSession
$useEmacsStyleLineStart: boolean

Methods

  • Parameters

    • options: Partial<SearchOptions>
    • Optional $disableFakeMultiline: boolean

    Returns any

  • Parameters

    • session: EditSession
    • options: any

    Returns false | {
        forEach: ((callback) => void);
    }

  • Parameters

    • editor: Editor
    • options: Partial<SearchOptions>

    Returns void

  • Parameters

    • editor: Editor

    Returns void

  • Enables occur mode. expects that options.needle is a search term. This search term is used to filter out all the lines that include it and these are then used as the content of a new [[Document Document]]. The current cursor position of editor will be translated so that the cursor is on the matching row/column as it was before.

    Parameters

    • editor: Editor
    • options: any

      options.needle should be a String

    Returns boolean

    Whether occur activation was successful

  • Disables occur mode. Resets the [[Sessions EditSession]] [[Document Document]] back to the original doc. If options.translatePosition is truthy also maps the [[Editors Editor]] cursor position accordingly.

    Parameters

    • editor: Editor
    • options: any

      options.translatePosition

    Returns boolean

    Whether occur deactivation was successful

  • Searches for options.needle. If found, this method returns the [[Range Range]] where the text first occurs. If options.backwards is true, the search goes backwards in the session.

    Parameters

    • session: EditSession

      The session to search with

    Returns false | Range

  • Searches for all occurrances options.needle. If found, this method returns an array of [[Range Ranges]] where the text first occurs. If options.backwards is true, the search goes backwards in the session.

    Parameters

    • session: EditSession

      The session to search with

    Returns Range[]

  • [Returns an object containing all the search options.]{: #Search.getOptions}

    Returns Partial<SearchOptions>

  • Parameters

    • sess: EditSession
    • regexp: RegExp

    Returns void

  • Parameters

    • session: EditSession
    • options: Partial<SearchOptions>

    Returns any[]

  • Translates the position from the occur document to the original document or pos if not found.

    Parameters

    • session: EditSession

      The occur session

    • pos: Point

      The position in the occur session document

    Returns Point

    position

  • Translates the position from the original document to the occur lines in the document or the beginning if the doc {row: 0, column: 0} if not found.

    Parameters

    • session: EditSession

      The occur session

    • pos: Point

      The position in the original document

    Returns Point

    position in occur doc

  • Searches for options.needle in input, and, if found, replaces it with replacement.

    Parameters

    • input: string

      The text to search in

    • replacement: any

      The replacing text

      • (String): If options.regExp is true, this function returns input with the replacement already made. Otherwise, this function just returns replacement.
        If options.needle was not found, this function returns null.

    Returns string

  • Sets the search options via the options parameter.

    Parameters

    • options: Partial<SearchOptions>

      An object containing all the new search properties

    Returns Search

    Chainable

  • Sets the search options via the options parameter.

    Parameters

    • options: Partial<SearchOptions>

      object containing all the search propertie

    Returns void

    Related

    Search.set

Generated using TypeDoc