Expand description
Selecting terminal content between two endpoints.
The start and end values are GridRef values. They are therefore
untracked grid references and inherit the same lifetime rules: they are
only safe to use until the next mutating operation on the terminal that
produced them, including dropping the terminal. To keep a selection valid
across terminal mutations, callers must maintain tracked grid references
for the endpoints and reconstruct a Selection from fresh snapshots
when needed.
Selections can be directly obtained by calling methods such as
Terminal::select_all, Terminal::select_word, etc., but this can be
quite cumbersome to use for terminal emulators designed for human users.
For this use case, selection gestures serve as a convenient
way of translating common UI actions (clicking, dragging, etc.) into selections,
to be copied, formatted, or installed as the active selection.
Modules§
- gesture
- Selection gestures provide a reusable state machine for turning UI pointer interactions into selection snapshots.
Structs§
- Format
Options - Options for one-shot formatting of a terminal selection.
- Select
Line Options - Options for deriving a line selection from a terminal grid reference.
- Select
Word Between Options - Options for deriving the nearest word selection between two grid references.
- Select
Word Options - Options for deriving a word selection from a terminal grid reference.
- Selection
- A snapshot selection range defined by two grid references.
Enums§
- Adjustment
- Operation used to adjust a selection endpoint.
- Order
- Ordering of a selection’s endpoints in terminal coordinates.