A command that modifies text / cursor state on a model.

interface ICommand {
    computeCursorState(model, helper): Selection;
    getEditOperations(model, builder): void;
}

Methods

  • Compute the cursor state after the edit operations were applied.

    Parameters

    • model: ITextModel

      The model the command has executed on.

    • helper: ICursorStateComputerData

      A helper to get inverse edit operations and to get previously tracked selections.

    Returns Selection

    The cursor state after the command executed.

  • Get the edit operations needed to execute this command.

    Parameters

    • model: ITextModel

      The model the command will execute on.

    • builder: IEditOperationBuilder

      A helper to collect the needed edit operations and to track selections.

    Returns void