module
TermBuf::Ops
Overview
The vocabulary the painter emits and the encoder turns into bytes.
Keeping the two apart is what makes the paint algorithm testable: a spec can assert the structure of what was decided without pinning the exact escape sequences, and pin the sequences separately where the byte count is the point.
The division of labour is that the painter says what goes where, and the
encoder works out how to say it in the fewest bytes. So the painter emits a
MoveTo before every run and a SetStyle for every run, and leaves it to
the encoder to drop the ones that are already true and to pick between
CUP, CHA, CUF, and a carriage return.