Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IEditOperationBuilder

A builder and helper for edit operations for a command.

Hierarchy

  • IEditOperationBuilder

Index

Methods

addEditOperation

  • addEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void
  • Add a new edit operation (a replace operation).

    Parameters

    • range: IRange

      The range to replace (delete). May be empty to represent a simple insert.

    • text: string | null

      The text to replace with. May be null to represent a simple delete.

    • Optional forceMoveMarkers: boolean

    Returns void

addTrackedEditOperation

  • addTrackedEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void
  • Add a new edit operation (a replace operation). The inverse edits will be accessible in ICursorStateComputerData.getInverseEditOperations()

    Parameters

    • range: IRange

      The range to replace (delete). May be empty to represent a simple insert.

    • text: string | null

      The text to replace with. May be null to represent a simple delete.

    • Optional forceMoveMarkers: boolean

    Returns void

trackSelection

  • trackSelection(selection: Selection, trackPreviousOnEmpty?: boolean): string
  • Track selection when applying edit operations. A best effort will be made to not grow/expand the selection. An empty selection will clamp to a nearby character.

    Parameters

    • selection: Selection

      The selection to track.

    • Optional trackPreviousOnEmpty: boolean

      If set, and the selection is empty, indicates whether the selection should clamp to the previous or the next character.

    Returns string

    A unique identifier.

Generated using TypeDoc