MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / applyPositionedHighlight

Function applyPositionedHighlight

source code/ink/render-to-screen.ts:214–233  ·  view source on GitHub ↗
(
  screen: Screen,
  stylePool: StylePool,
  positions: MatchPosition[],
  rowOffset: number,
  currentIdx: number,
)

Source from the content-addressed store, hash-verified

212 * Positions are message-relative (row 0 = message top). rowOffset =
213 * message's current screen-top (lo). Clips outside [0, height). */
214export function applyPositionedHighlight(
215 screen: Screen,
216 stylePool: StylePool,
217 positions: MatchPosition[],
218 rowOffset: number,
219 currentIdx: number,
220): boolean {
221 if (currentIdx < 0 || currentIdx >= positions.length) return false
222 const p = positions[currentIdx]!
223 const row = p.row + rowOffset
224 if (row < 0 || row >= screen.height) return false
225 const transform = (id: number) => stylePool.withCurrentMatch(id)
226 const rowOff = row * screen.width
227 for (let col = p.col; col < p.col + p.len; col++) {
228 if (col < 0 || col >= screen.width) continue
229 const cell = cellAtIndex(screen, rowOff + col)
230 setCellStyleId(screen, col, row, transform(cell.styleId))
231 }
232 return true
233}

Callers 1

onRenderMethod · 0.85

Calls 3

cellAtIndexFunction · 0.85
setCellStyleIdFunction · 0.85
transformFunction · 0.85

Tested by

no test coverage detected