Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a text selection in an editor.

Hierarchy

Index

Constructors

constructor

  • Create a selection from two positions.

    Parameters

    Returns Selection

  • Create a selection from coordinates.

    Parameters

    • anchorLine: number

      a zero based line value

    • anchorChar: number

      a zero based character value

    • activeLine: number

      a zero based line value

    • activeChar: number

      a zero based character value

    Returns Selection

Properties

active

active: Position

Position of the cursor

anchor

anchor: Position

Position where selection starts.

end

End position.

isEmpty

isEmpty: boolean

true if start and end are equal

isReversed

isReversed: boolean

A selection is reversed if active.isBefore(anchor)

isSingleLine

isSingleLine: boolean

true if start.line and end.line are equal

start

start: Position

Start position.

Methods

contains

intersection

isEqual

  • isEqual(other: Range): boolean

union

with