MCPcopy Create free account
hub / github.com/Noumena-Network/code / diffRowAdded

Function diffRowAdded

src/ink/screen.ts:1651–1667  ·  view source on GitHub ↗

* Emit additions for a row that only exists in next (height grew). * Skips empty/unwritten cells.

(
  nextCells: Int32Array,
  next: Screen,
  ci: number,
  y: number,
  startX: number,
  endX: number,
  nextCell: Cell,
  cb: DiffCallback,
)

Source from the content-addressed store, hash-verified

1649 * Skips empty/unwritten cells.
1650 */
1651function diffRowAdded(
1652 nextCells: Int32Array,
1653 next: Screen,
1654 ci: number,
1655 y: number,
1656 startX: number,
1657 endX: number,
1658 nextCell: Cell,
1659 cb: DiffCallback,
1660): boolean {
1661 for (let x = startX; x < endX; x++, ci += 2) {
1662 if (nextCells[ci] === 0 && nextCells[ci | 1] === 0) continue
1663 cellAtCI(next, ci, nextCell)
1664 if (cb(x, y, undefined, nextCell)) return true
1665 }
1666 return false
1667}
1668
1669/**
1670 * Diff two screens with identical width.

Callers 1

diffSameWidthFunction · 0.85

Calls 1

cellAtCIFunction · 0.85

Tested by

no test coverage detected