A selection owner.

interface ISelectionOwner {
    uuid: string;
    getCursorPosition(): IPosition;
    getSelection(): IRange;
    getSelections(): IRange[];
    setCursorPosition(position, options?): void;
    setSelection(selection): void;
    setSelections(selections): void;
}

Hierarchy (view full)

Properties

uuid: string

The uuid of this selection owner.

Methods

  • Set the primary position of the cursor.

    Parameters

    • position: IPosition

      The new primary position.

    • Optional options: {
          scroll?: boolean;
      }

      Adjustment options allowing to disable scrolling.

      Notes

      This will remove any secondary cursors.

      • Optional scroll?: boolean

    Returns void

  • Sets the selections for all the cursors.

    Parameters

    • selections: IRange[]

      The new selections.

      Notes

      Cursors will be removed or added, as necessary. Passing an empty array resets a cursor position to the start of a document.

    Returns void