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

Function applyPositionedHighlight

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

Source from the content-addressed store, hash-verified

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

Callers 1

onRenderMethod · 0.85

Calls 3

cellAtIndexFunction · 0.85
setCellStyleIdFunction · 0.85
transformFunction · 0.85

Tested by

no test coverage detected