diff --git a/src/lib/components/events/content/Patch.svelte b/src/lib/components/events/content/Patch.svelte index 45031a6..3ec7d87 100644 --- a/src/lib/components/events/content/Patch.svelte +++ b/src/lib/components/events/content/Patch.svelte @@ -1,12 +1,12 @@
@@ -29,31 +46,76 @@
commit
-
- - - - - - {#each files as file} - - - - - {/each} -
Changes: - {commit_id_shorthand} -
- - {file.to || file.from} - - - +{file.additions} - - {file.deletions} -
+
+
Changes:
+
+ {commit_id_shorthand} +
+ + {#each files as file, index} +
+ + {#if expand_files[index]} +
+ {#each file.chunks as chunk} + {#each chunk.changes as change, i} +
+
+ {isAddChange(change) && + i !== 0 && + isDeleteChange(chunk.changes[i - 1]) + ? '' + : extractChangeLine(change)} +
+
+ {change.type == 'normal' + ? change.content + : change.content.substring(1)} +
+
+ {/each} + {/each} +
+ {/if} +
+ {/each}