MCPcopy Index your code
hub / github.com/codeaashu/claude-code / diffRowBoth

Function diffRowBoth

src/ink/screen.ts:1230–1256  ·  view source on GitHub ↗

* Diff one row where both screens are in bounds. * Scans for differences with findNextDiff, unpacks and calls cb for each.

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

Source from the content-addressed store, hash-verified

1228 * Scans for differences with findNextDiff, unpacks and calls cb for each.
1229 */
1230function diffRowBoth(
1231 prevCells: Int32Array,
1232 nextCells: Int32Array,
1233 prev: Screen,
1234 next: Screen,
1235 ci: number,
1236 y: number,
1237 startX: number,
1238 endX: number,
1239 prevCell: Cell,
1240 nextCell: Cell,
1241 cb: DiffCallback,
1242): boolean {
1243 let x = startX
1244 while (x < endX) {
1245 const skip = findNextDiff(prevCells, nextCells, ci, endX - x)
1246 x += skip
1247 ci += skip << 1
1248 if (x >= endX) break
1249 cellAtCI(prev, ci, prevCell)
1250 cellAtCI(next, ci, nextCell)
1251 if (cb(x, y, prevCell, nextCell)) return true
1252 x++
1253 ci += 2
1254 }
1255 return false
1256}
1257
1258/**
1259 * Emit removals for a row that only exists in prev (height shrank).

Callers 1

diffSameWidthFunction · 0.85

Calls 2

findNextDiffFunction · 0.85
cellAtCIFunction · 0.85

Tested by

no test coverage detected