CellSelection

data class CellSelection(val anchorColumn: Int, val anchorRow: Int, val caretColumn: Int, val caretRow: Int, val isBlock: Boolean = false)

Half-open terminal cell selection in visible render-cache coordinates.

anchorColumn and anchorRow identify the fixed selection edge. caretColumn and caretRow identify the moving edge and may be before the anchor for backward selections. Columns are caret positions between cells, so selecting cells 2 through 4 on one row is represented as columns 2..5.

Constructors

Link copied to clipboard
constructor(anchorColumn: Int, anchorRow: Int, caretColumn: Int, caretRow: Int, isBlock: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

zero-based anchor caret column.

Link copied to clipboard

zero-based anchor row.

Link copied to clipboard

zero-based moving caret column.

Link copied to clipboard

zero-based moving row.

Link copied to clipboard

End-exclusive selected caret column on endRow.

Link copied to clipboard
val endRow: Int

Last selected row after normalizing anchor and caret order.

Link copied to clipboard

whether the selection is a rectangular block selection.

Link copied to clipboard

Returns true when the selection covers no cells.

Link copied to clipboard

First selected caret column on startRow.

Link copied to clipboard

First selected row after normalizing anchor and caret order.

Functions

Link copied to clipboard
fun packedColumnRange(row: Int, columns: Int, cache: TerminalRenderCache? = null): Long

Returns the selected half-open column range for row, packed as start shl 32 | end, or NO_RANGE when row is outside the selection.