Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Occur

Index

Constructors

constructor

Methods

enter

  • enter(editor: Editor, options: Object): boolean
  • 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. 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: Object

      options.needle should be a String

    Returns boolean

    Whether occur activation was successful

exit

  • exit(editor: Editor, options: Object): boolean
  • Disables occur mode. Resets the [[Sessions EditSession]] Document back to the original doc. If options.translatePosition is truthy also maps the [[Editors Editor]] cursor position accordingly.

    Parameters

    • editor: Editor
    • options: Object

      options.translatePosition

    Returns boolean

    Whether occur deactivation was successful

occurToOriginalPosition

  • occurToOriginalPosition(session: EditSession, pos: Object): Object
  • Translates the position from the occur document to the original document or pos if not found.

    Parameters

    • session: EditSession

      The occur session

    • pos: Object

      The position in the occur session document

    Returns Object

    position

originalToOccurPosition

  • originalToOccurPosition(session: EditSession, pos: Object): { column: any; row: number }
  • 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: Object

      The position in the original document

    Returns { column: any; row: number }

    position in occur doc

    • column: any
    • row: number

Generated using TypeDoc