diff --git a/src/Service/SnipContent/MyersDiff.php b/src/Service/SnipContent/MyersDiff.php index 155d804..5f52d3c 100644 --- a/src/Service/SnipContent/MyersDiff.php +++ b/src/Service/SnipContent/MyersDiff.php @@ -187,6 +187,7 @@ class MyersDiff case DiffTypeEnum::KEEP->value: for ($i = 0; $i < $data; $i++) { $lines[] = [ + 'line' => $x, 'type' => 'keep', 'from' => $a[$x], 'to' => $a[$x], @@ -197,6 +198,7 @@ class MyersDiff case DiffTypeEnum::DELETE->value: for ($i = 0; $i < $data; $i++) { $lines[] = [ + 'line' => $x, 'type' => 'delete', 'from' => $a[$x], 'to' => '', @@ -207,6 +209,7 @@ class MyersDiff case DiffTypeEnum::INSERT->value: foreach ($data as $v) { $lines[] = [ + 'line' => $x, 'type' => 'insert', 'from' => '', 'to' => $v, diff --git a/templates/content/compare.html.twig b/templates/content/compare.html.twig index ac00bfd..7c37fe7 100644 --- a/templates/content/compare.html.twig +++ b/templates/content/compare.html.twig @@ -7,10 +7,11 @@ Back

- +
+ @@ -18,19 +19,12 @@ {% for line in diff %} + - - + + {% endfor %}
LineType Old New
{{ line.line }}. {{ line.type }} - {% if line.from %} - {{ line.from }} - {% endif %} - - {% if line.to %} - {{ line.to }} - {% endif %} - {{ line.from }}{{ line.to }}