TextPosition

data class TextPosition(val row: Int, val column: Int) : Comparable<TextPosition>

Holds the row and column data for caret/anchor positions within a TextArea. Both row and column are zero based, so the start of a document is (0,0).

NOTE, Think of a TextPosition representing a vertical line next to a character. Do NOT think of it as an index of a particular character.

This is important when considering the range of acceptable values. If a line contains "Hi", then column can range from 0 to 2 INCLUSIVE. (the imaginary line can be after the i).

It's also important to realise that it is meaningless to ask what is the character at this [TextPosition] only after or before a TextPosition.

Constructors

Link copied to clipboard
constructor(row: Int, column: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val column: Int
Link copied to clipboard
val row: Int

Functions

Link copied to clipboard
open operator override fun compareTo(other: TextPosition): Int
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String