Expand description
The main loop, minus the terminal.
run() sets the terminal up and hands EventPump::run a way to draw a frame;
keys reach the pump through the same channel as worker results
(crate::terminal_input), so the loop sleeps until either arrives or a deadline
passes (Pacer). Everything between, including what happens to a key typed
while the app is busy, lives here so it can be driven without a terminal. Keys
typed while busy are held, in order, and replayed one per
loop iteration once the app is idle, each through the same path a fresh key takes.
Any follow-up event a replayed key produces is drained before the next held key is
offered, so a queued Enter finishes its search before the key typed after it acts.
Structs§
- Event
Pump - Owns the app, its channel and the keys held while it was busy.
- Pacer
- When the run loop draws, and how long it may sleep.
Enums§
Constants§
- MAX_
HELD_ KEYS - Keys held while busy. Beyond this the newest is dropped, and the user told: the
oldest may be the
/that puts the rest into the query bar, and without it the tail of a typed query would replay as hotkeys. - PROGRESS_
FRAME - The least time between two frames drawn for progress reports alone. A worker reporting a thousand times a second is drawn thirty times; a key or a result is drawn at once.
- SPINNER_
FRAME - How often a spinner turns: about 30 frames a second, plenty for a throbber.