x4js - v2.2.49
    Preparing search index...

    A builder and helper for edit operations for a command.

    interface IEditOperationBuilder {
        addEditOperation(
            range: IRange,
            text: string,
            forceMoveMarkers?: boolean,
        ): void;
        addTrackedEditOperation(
            range: IRange,
            text: string,
            forceMoveMarkers?: boolean,
        ): void;
        trackSelection(
            selection: Selection,
            trackPreviousOnEmpty?: boolean,
        ): string;
    }
    Index
    • 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

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

      • OptionalforceMoveMarkers: boolean

      Returns 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

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

      • OptionalforceMoveMarkers: boolean

      Returns void

    • 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.

      • OptionaltrackPreviousOnEmpty: 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.