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

Function expandDiffTabs

src/ui/diff/codeColumns.ts:12–14  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

10
11/** Expand tabs the same way the diff renderer does before measuring visible columns. */
12export function expandDiffTabs(text: string) {
13 return text.replaceAll("\t", " ".repeat(DIFF_CODE_TAB_WIDTH));
14}
15
16/** Measure one rendered code line after tab expansion and newline trimming. */
17export function measureRenderedCodeLineWidth(line: string | undefined) {

Callers 3

tabifyFunction · 0.90
spansForFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected