Skip to content

Cm5Range

Unofficial

A selection range in a CodeMirror 5 document.

Import:

import type { Cm5Range } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface Cm5Range

Properties

PropertyTypeDescription
anchorPositionThe fixed end of the selection.
headPositionThe moving end of the selection.

Methods

MethodReturnsDescription
empty()booleanReturns true if the range is empty (anchor equals head).
from()PositionReturns the earlier of anchor and head.
to()PositionReturns the later of anchor and head.

Links to this page: