TuiBufferDiff
The set of rows that changed between two {@see \Milpa\Live\Contracts\Tui\VirtualTerminalBufferInterface} states, as produced by {@see \Milpa\Live\Contracts\Tui\VirtualTerminalBufferInterface::diff()} — the minimal-repaint unit the TUI runtime writes to the real terminal.
TuiBufferDiff::__construct()
public function __construct(array $changes):Parameters
| Name | Type | Description |
|---|---|---|
| $changes | array<int, array{row: int, line: string}> | Changed rows, each the row's 0-based index and its full new line content. |
TuiBufferDiff::isEmpty()
public function isEmpty(): boolWhether nothing changed (no rows to repaint).
TuiBufferDiff::renderAnsiPatch()
public function renderAnsiPatch(): stringRenders this diff as an ANSI escape sequence that repositions the cursor to each changed row (1-based, column 1) and writes its new content — a minimal patch suitable for writing directly to a real terminal instead of redrawing the full screen.