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

Function measureRenderedCodeLineWidth

src/ui/diff/codeColumns.ts:17–19  ·  view source on GitHub ↗
(line: string | undefined)

Source from the content-addressed store, hash-verified

15
16/** Measure one rendered code line after tab expansion and newline trimming. */
17export function measureRenderedCodeLineWidth(line: string | undefined) {
18 return measureTextWidth(expandDiffTabs((line ?? "").replace(/\n$/, "")));
19}
20
21/** Track the widest rendered code line for one file. */
22export function maxFileCodeLineWidth(file: DiffFile) {

Callers 1

maxFileCodeLineWidthFunction · 0.85

Calls 2

measureTextWidthFunction · 0.90
expandDiffTabsFunction · 0.85

Tested by

no test coverage detected