From 4151e7bb81d928633e253be1f40a96a1dea47027 Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Thu, 15 Feb 2024 10:05:43 -0500 Subject: [PATCH] Fix spacing between component table and added/removed items (#242) --- .../com/jakewharton/diffuse/diff/ComponentDiff.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/reports/src/main/kotlin/com/jakewharton/diffuse/diff/ComponentDiff.kt b/reports/src/main/kotlin/com/jakewharton/diffuse/diff/ComponentDiff.kt index 57deb5a7..dbf1e85b 100644 --- a/reports/src/main/kotlin/com/jakewharton/diffuse/diff/ComponentDiff.kt +++ b/reports/src/main/kotlin/com/jakewharton/diffuse/diff/ComponentDiff.kt @@ -55,14 +55,17 @@ internal fun StringBuilder.appendComponentDiff(name: String, diff: ComponentDiff row(diff.oldCount, diff.newCount, "$diffSize ($addedSize $removedSize)") }.renderText(), ) - diff.added.forEach { - appendLine("+ $it") - } - if (diff.added.isNotEmpty() && diff.removed.isNotEmpty()) { + if (diff.added.isNotEmpty()) { appendLine() + diff.added.forEach { + appendLine("+ $it") + } } - diff.removed.forEach { - appendLine("- $it") + if (diff.removed.isNotEmpty()) { + appendLine() + diff.removed.forEach { + appendLine("- $it") + } } }.prependIndent(" "), )