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

Function addLineNumber

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

Source from the content-addressed store, hash-verified

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