Liking cljdoc? Tell your friends :D

dots.vscode.selection

Represents a text selection in an editor.

Represents a text selection in an editor.
raw docstring

activecljs

(active selection)

The position of the cursor. This position might be before or after {@link Selection.anchor anchor}.

Returns: Position

The position of the cursor.
This position might be before or after {@link Selection.anchor anchor}.

**Returns:** `Position`
sourceraw docstring

anchorcljs

(anchor selection)

The position at which the selection starts. This position might be before or after {@link Selection.active active}.

Returns: Position

The position at which the selection starts.
This position might be before or after {@link Selection.active active}.

**Returns:** `Position`
sourceraw docstring

contains?cljs

(contains? selection position-or-range)

Check if a position or a range is contained in this range.

Parameters:

  • position-or-range: Range | Position - A position or a range.

Returns: boolean - true if the position or range is inside or equal to this range.

Check if a position or a range is contained in this range.

**Parameters:**
- `position-or-range`: `Range | Position` - A position or a range.

**Returns:** `boolean` - `true` if the position or range is inside or equal
to this range.
sourceraw docstring

empty?cljs

(empty? selection)

true if start and end are equal.

Returns: boolean

`true` if `start` and `end` are equal.

**Returns:** `boolean`
sourceraw docstring

endcljs

(end selection)

The end position. It is after or equal to {@link Range.start start}.

Returns: Position

The end position. It is after or equal to {@link Range.start start}.

**Returns:** `Position`
sourceraw docstring

equal?cljs

(equal? selection other)

Check if other equals this range.

Parameters:

  • other: Range - A range.

Returns: boolean - true when start and end are {@link Position.isEqualequal} to start and end of this range.

Check if `other` equals this range.

**Parameters:**
- `other`: `Range` - A range.

**Returns:** `boolean` - `true` when start and end are {@link Position.isEqualequal} to
start and end of this range.
sourceraw docstring

intersectioncljs

(intersection selection range)

Intersect range with this range and returns a new range or undefined if the ranges have no overlap.

Parameters:

  • range: Range - A range.

Returns: Range | undefined - A range of the greater start and smaller end positions. Will return undefined when there is no overlap.

Intersect `range` with this range and returns a new range or `undefined`
if the ranges have no overlap.

**Parameters:**
- `range`: `Range` - A range.

**Returns:** `Range | undefined` - A range of the greater start and smaller end positions. Will
return undefined when there is no overlap.
sourceraw docstring

reversed?cljs

(reversed? selection)

A selection is reversed if its {@link Selection.anchor anchor} is the {@link Selection.end end} position.

Returns: boolean

A selection is reversed if its {@link Selection.anchor anchor} is the {@link Selection.end end} position.

**Returns:** `boolean`
sourceraw docstring

set-active!cljs

(set-active! selection value)

The position of the cursor. This position might be before or after {@link Selection.anchor anchor}.

The position of the cursor.
This position might be before or after {@link Selection.anchor anchor}.
sourceraw docstring

set-anchor!cljs

(set-anchor! selection value)

The position at which the selection starts. This position might be before or after {@link Selection.active active}.

The position at which the selection starts.
This position might be before or after {@link Selection.active active}.
sourceraw docstring

set-is-empty!cljs

(set-is-empty! selection value)

true if start and end are equal.

`true` if `start` and `end` are equal.
sourceraw docstring

set-is-reversed!cljs

(set-is-reversed! selection value)

A selection is reversed if its {@link Selection.anchor anchor} is the {@link Selection.end end} position.

A selection is reversed if its {@link Selection.anchor anchor} is the {@link Selection.end end} position.
sourceraw docstring

set-is-single-line!cljs

(set-is-single-line! selection value)

true if start.line and end.line are equal.

`true` if `start.line` and `end.line` are equal.
sourceraw docstring

single-line?cljs

(single-line? selection)

true if start.line and end.line are equal.

Returns: boolean

`true` if `start.line` and `end.line` are equal.

**Returns:** `boolean`
sourceraw docstring

startcljs

(start selection)

The start position. It is before or equal to {@link Range.end end}.

Returns: Position

The start position. It is before or equal to {@link Range.end end}.

**Returns:** `Position`
sourceraw docstring

unioncljs

(union selection other)

Compute the union of other with this range.

Parameters:

  • other: Range - A range.

Returns: Range - A range of smaller start position and the greater end position.

Compute the union of `other` with this range.

**Parameters:**
- `other`: `Range` - A range.

**Returns:** `Range` - A range of smaller start position and the greater end position.
sourceraw docstring

withcljs

(with selection)
(with selection change)
(with selection start)
(with selection start end)

Derived a new range from this range.

Parameters:

  • change: { start?: Position | undefined; end?: Position | undefined; } - An object that describes a change to this range.
  • start: Position | undefined - A position that should be used as start. The default value is the {@link Range.start current start}.
  • end: Position | undefined - A position that should be used as end. The default value is the {@link Range.end current end}.

Returns: Range - A range that reflects the given change. Will return this range if the change is not changing anything.

Derived a new range from this range.

**Parameters:**
- `change`: `{ start?: Position | undefined; end?: Position | undefined; }` - An object that describes a change to this range.
- `start`: `Position | undefined` - A position that should be used as start. The default value is the {@link Range.start current start}.
- `end`: `Position | undefined` - A position that should be used as end. The default value is the {@link Range.end current end}.

**Returns:** `Range` - A range that reflects the given change. Will return `this` range if the change
is not changing anything.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close