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

Function setCellStyleId

src/ink/screen.ts:817–839  ·  view source on GitHub ↗
(
  screen: Screen,
  x: number,
  y: number,
  styleId: number,
)

Source from the content-addressed store, hash-verified

815 * for the cell so diffEach picks up the change.
816 */
817export function setCellStyleId(
818 screen: Screen,
819 x: number,
820 y: number,
821 styleId: number,
822): void {
823 if (x < 0 || y < 0 || x >= screen.width || y >= screen.height) return
824 const ci = (y * screen.width + x) << 1
825 const cells = screen.cells
826 const word1 = cells[ci + 1]!
827 const width = word1 & WIDTH_MASK
828 // Skip spacer cells — inverse on the head cell visually covers both columns
829 if (width === CellWidth.SpacerTail || width === CellWidth.SpacerHead) return
830 const hid = (word1 >>> HYPERLINK_SHIFT) & HYPERLINK_MASK
831 cells[ci + 1] = packWord1(styleId, hid, width)
832 // Expand damage so diffEach scans this cell
833 const d = screen.damage
834 if (d) {
835 screen.damage = unionRect(d, { x, y, width: 1, height: 1 })
836 } else {
837 screen.damage = { x, y, width: 1, height: 1 }
838 }
839}
840
841/**
842 * Intern a character string via the screen's shared CharPool.

Callers 3

applyPositionedHighlightFunction · 0.85
applySelectionOverlayFunction · 0.85
applySearchHighlightFunction · 0.85

Calls 2

packWord1Function · 0.85
unionRectFunction · 0.85

Tested by

no test coverage detected