Skip to content

Cm5Range

Unofficial

A selection range in a CodeMirror 5 document.

Import:

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

Signature:

export interface Cm5Range

Properties

Property Type Description
anchor Position The fixed end of the selection.
head Position The moving end of the selection.

Methods

Method Returns Description
empty() boolean Returns true if the range is empty (anchor equals head).
from() Position Returns the earlier of anchor and head.
to() Position Returns the later of anchor and head.

Links to this page: