Represents a text selection in an editor.
Online Documentation
Create a selection from two positions.
Create a selection from four coordinates.
The position of the cursor. This position might be before or after anchor.
The position at which the selection starts. This position might be before or after active.
The end position. It is after or equal to start.
true if start and end are equal.
true
start
end
A selection is reversed if its anchor is the end position.
true if start.line and end.line are equal.
start.line
end.line
The start position. It is before or equal to end.
Check if a position or a range is contained in this range.
Intersect range with this range and returns a new range or undefined if the ranges have no overlap.
range
undefined
Check if other equals this range.
other
Compute the union of other with this range.
Derived a new range from this range.