#[repr(C)]pub struct Selection {
pub size: usize,
pub start: GridRef,
pub end: GridRef,
pub rectangle: bool,
}Expand description
A snapshot selection range defined by two grid references.
Both endpoints are inclusive. The endpoints preserve selection direction and may be reversed; callers must not assume that start is the top-left endpoint or that end is the bottom-right endpoint.
When rectangle is false, the endpoints describe a linear selection. When rectangle is true, the same endpoints are interpreted as opposite corners of a rectangular/block selection.
The start and end values are untracked GhosttyGridRef snapshots and are only valid until the next mutating operation on the terminal that produced them unless the selection is reconstructed from tracked references.
This is a sized struct. Use GHOSTTY_INIT_SIZED() to initialize it.
Fields§
§size: usizeSize of this struct in bytes. Must be set to sizeof(GhosttySelection).
start: GridRefStart of the selection range (inclusive).
This may be after end in terminal order. It is an untracked GhosttyGridRef snapshot and follows untracked grid-ref lifetime rules.
end: GridRefEnd of the selection range (inclusive).
This may be before start in terminal order. It is an untracked GhosttyGridRef snapshot and follows untracked grid-ref lifetime rules.
rectangle: boolWhether the endpoints are interpreted as a rectangular/block selection rather than a linear selection.