MCPcopy Create free account
hub / github.com/modem-dev/hunk / splitGutterText

Function splitGutterText

src/ui/diff/rowStyle.ts:163–176  ·  view source on GitHub ↗
(
  cell: SplitLineCell,
  lineNumberDigits: number,
  showLineNumbers: boolean,
)

Source from the content-addressed store, hash-verified

161
162/** Build the split-view gutter text shared by the TUI and clipboard renderers. */
163export function splitGutterText(
164 cell: SplitLineCell,
165 lineNumberDigits: number,
166 showLineNumbers: boolean,
167) {
168 if (!showLineNumbers) {
169 return `${cell.sign} `;
170 }
171
172 const number = cell.lineNumber
173 ? String(cell.lineNumber).padStart(lineNumberDigits, " ")
174 : " ".repeat(lineNumberDigits);
175 return `${number} ${cell.sign}`;
176}

Callers 4

staticSplitGutterTextFunction · 0.90
buildWrappedSplitCellFunction · 0.90
buildPlainSplitCellLinesFunction · 0.90
renderSplitCellFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected