MCPcopy Create free account
hub / github.com/codeaashu/claude-code / addLineNumber

Function addLineNumber

src/native-ts/color-diff/index.ts:726–745  ·  view source on GitHub ↗
(
  h: Highlight,
  theme: Theme,
  maxDigits: number,
  fullDim: boolean,
)

Source from the content-addressed store, hash-verified

724}
725
726function addLineNumber(
727 h: Highlight,
728 theme: Theme,
729 maxDigits: number,
730 fullDim: boolean,
731): void {
732 const style: Style = {
733 foreground: h.marker ? decorationColor(h.marker, theme) : theme.foreground,
734 background: h.marker ? lineBackground(h.marker, theme) : theme.background,
735 }
736 const shouldDim = h.marker === null || h.marker === ' '
737 for (let i = 0; i < h.lines.length; i++) {
738 const prefix =
739 i === 0
740 ? ` ${String(h.lineNumber).padStart(maxDigits)} `
741 : ' '.repeat(maxDigits + 2)
742 const wrapped = shouldDim && !fullDim ? `${DIM}${prefix}${UNDIM}` : prefix
743 h.lines[i]!.unshift([style, wrapped])
744 }
745}
746
747function addMarker(h: Highlight, theme: Theme): void {
748 if (!h.marker) return

Callers 2

renderMethod · 0.85
renderMethod · 0.85

Calls 2

decorationColorFunction · 0.85
lineBackgroundFunction · 0.85

Tested by

no test coverage detected