TextEditorRange

data class TextEditorRange(val start: CharLineOffset, val end: CharLineOffset)(source)

A region of the document from start (inclusive) to end (exclusive), the unit used for selections, edits, and rich spans. Build one from two CharLineOffsets with fromOffsets or CharLineOffset.toRange, which order the endpoints for you.

Constructors

Link copied to clipboard
constructor(start: CharLineOffset, end: CharLineOffset)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns an IntRange representing the line numbers that this TextEditorRange spans.

fun affectedLines(buffer: Int, maxLines: Int): IntRange

Returns an IntRange representing the line numbers that this TextEditorRange spans, with an optional buffer of additional lines on either side.

Link copied to clipboard

Returns an IntRange representing the line wrap numbers that this TextEditorRange spans.

Link copied to clipboard
fun containsLine(lineIndex: Int): Boolean

True if lineIndex falls within the lines this range covers.

Link copied to clipboard

True if this range and other overlap by at least one position.

Link copied to clipboard

True if the range begins and ends on the same line.

Link copied to clipboard

Returns the smallest range that covers both this range and other.

Link copied to clipboard

True if end is strictly after start (i.e. the range is non-empty and well-ordered).