Expand description
Host-side glue for the Neovim backend.
The backend (NvimBackend) owns the nvim process and its snapshot. This
module owns the host policy that sits between that backend and the app:
the ZZ/ZQ and :wq/:q quit intercepts, and the per-frame
content_gen → content_revision mirror.
As with the decode seam, the fragile part is pulled
out as a pure decision (classify_nvim_key) that is fully testable with
no nvim process: given the pending-Z state, the key, the mode and the
command line, it returns what to do. NvimHost is the thin stateful
shell that applies the decision — forwarding to nvim and emitting app events.
Structs§
- Frame
Sync - Values the render loop needs from the Nvim backend each frame.
- Nvim
Host - Host-side Nvim state: the only thing the host must track itself is the
pending-
Zflag for theZZ/ZQtwo-key sequence.
Enums§
- Nvim
KeyDecision - What a single key should do on the Nvim backend. Pure data — no I/O.
- Nvim
KeyResult - Outcome of applying a key on the Nvim backend. The host bumps the cursor generation only when a key was actually forwarded to nvim.
- Quit
Kind - Where a quit came from. Both side effects the host performs — whether to
autosave, and whether to
<Esc>nvim out of its current mode first — are derived from this, so a caller never has to coordinate two booleans.
Functions§
- classify_
nvim_ key - Decide what a key does on the Nvim backend. Pure: depends only on the pending-Z flag, the key, the current mode, and the command line.