Expand description
Diffing Engine: Generate minimal ANSI sequences from buffer changes.
This module implements the core anti-flicker logic:
- Compare Current and Next buffers
- Generate minimal ANSI escape sequences for changed cells
- Optimize cursor movements (skip if adjacent)
- Track color state to avoid redundant SGR sequences
All output is accumulated in a single buffer and flushed with one syscall.
Structs§
- Diff
Result - Result of a diff operation.
- Diff
State - State tracker for the diffing algorithm.
Functions§
- render_
diff - Render the difference between two buffers into an ANSI sequence buffer.
- render_
full - Generate a full redraw sequence (no diffing).
- render_
full_ diff - Perform a full buffer diff (convenience function).