DocPos

value class DocPos(val value: Int) : Comparable<DocPos>

A document position represented as a 0-based character offset.

This inline value class provides compile-time type safety for document positions with zero runtime overhead. Use DocPos instead of raw Int to distinguish document positions from other integer values like line numbers, counts, or indices.

Constructors

Link copied to clipboard
constructor(value: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val value: Int

Functions

Link copied to clipboard

Create a SelectionSpec placing the cursor at pos.

Link copied to clipboard
open operator override fun compareTo(other: DocPos): Int
Link copied to clipboard
operator fun minus(other: DocPos): Int
operator fun minus(offset: Int): DocPos
Link copied to clipboard
operator fun plus(offset: Int): DocPos
Link copied to clipboard
open override fun toString(): String