![]() |
libghostty
|
#include <ghostty/vt/selection.h>
Data Fields | |
| size_t | size |
| GhosttyGridRef | start |
| GhosttyGridRef | end |
| bool | rectangle |
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.
Definition at line 92 of file selection.h.
| GhosttyGridRef end |
End 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.
Definition at line 110 of file selection.h.
| bool rectangle |
Whether the endpoints are interpreted as a rectangular/block selection rather than a linear selection.
Definition at line 116 of file selection.h.
| size_t size |
Size of this struct in bytes. Must be set to sizeof(GhosttySelection).
Definition at line 94 of file selection.h.
| GhosttyGridRef start |
Start 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.
Definition at line 102 of file selection.h.