Expand description
Pure decode of the STATE_QUERY_LUA response into a DecodedState.
This is the decode seam: every nvim wire-format fact lives here and
nowhere else — the positional array shape, the byte-offset → char-index
conversion, the 1-indexed → 0-indexed shift, the mode-string → EditorMode
mapping, and the getpos('v') visual-mark math. The function is pure
(Value in, DecodedState out) so the whole contract is testable with
literal Values, without spawning a real nvim process.
Applying a DecodedState to the live Mutex<NvimSnapshot> — the
in_flight gate and the content_gen/dirty bookkeeping — stays in
backend.rs, because that is stateful backend bookkeeping, not decoding.
Enums§
- Decoded
State - One decoded
STATE_QUERY_LUAresponse.
Functions§
- decode
- Decode one
STATE_QUERY_LUAresponse. ReturnsNonewhen the value is not the expected array or the leading mode element is missing — the caller leaves the snapshot untouched in that case.