(patch: StructuredPatchHunk)
| 44 | // right-aligned line number (max_digits) + space. Depends only on patch |
| 45 | // identity (the WeakMap key), so it's cacheable alongside the NAPI output. |
| 46 | function computeGutterWidth(patch: StructuredPatchHunk): number { |
| 47 | const maxLineNumber = Math.max(patch.oldStart + patch.oldLines - 1, patch.newStart + patch.newLines - 1, 1); |
| 48 | return maxLineNumber.toString().length + 3; // marker + 2 padding spaces |
| 49 | } |
| 50 | |
| 51 | function renderColorDiff( |
| 52 | patch: StructuredPatchHunk, |
no test coverage detected