Browse Source

feat(patch): show all lines < 60

if there are in total less than 60 lines, ignore the rule
about only showing 20 lines per file
master
DanConwayDev 2 years ago
parent
commit
81da1d60c0
No known key found for this signature in database
GPG Key ID: 68E15486D73F75E1
  1. 6
      src/lib/components/events/content/Patch.svelte

6
src/lib/components/events/content/Patch.svelte

@ -19,6 +19,12 @@ @@ -19,6 +19,12 @@
let files = parseDiff(content)
let expand_files = files.map((file) => file.deletions + file.additions < 20)
if (
files.reduce((acc, file) => acc + file.deletions + file.additions, 0) < 60
) {
expand_files = expand_files.map((_) => true)
}
function extractTagContent(name: string): string | undefined {
let tag = tags.find((tag) => tag[0] === name)
return tag ? tag[1] : undefined

Loading…
Cancel
Save