diff --git a/src/components/diff/unified-diff-preview.tsx b/src/components/diff/unified-diff-preview.tsx index 9749e74..f25113e 100644 --- a/src/components/diff/unified-diff-preview.tsx +++ b/src/components/diff/unified-diff-preview.tsx @@ -446,9 +446,21 @@ function rowMarker(row: ParsedDiffRow): RowMarker { return "none" } +function HunkSeparator({ hunk }: { hunk: ParsedDiffHunk }) { + const label = + hunk.oldStart != null && hunk.oldCount != null + ? `@@ -${hunk.oldStart},${hunk.oldCount} +${hunk.newStart ?? hunk.oldStart},${hunk.newCount ?? hunk.oldCount} @@` + : "ยทยทยท" + return ( +
+ {label} +
+ ) +} + function HunkLines({ rows }: { rows: ParsedDiffRow[] }) { return ( -
+
{rows.map((row, i) => { const marker = rowMarker(row) return ( @@ -540,9 +552,14 @@ export function UnifiedDiffPreview({
- {file.hunks.map((hunk) => ( - - ))} +
+ {file.hunks.map((hunk, hunkIdx) => ( +
+ {hunkIdx > 0 && } + +
+ ))} +
))}