Skip to content

Commit f57c6c4

Browse files
SpacePossumsebastianbergmann
authored andcommitted
Do no add an empty line before every header.
1 parent 8664531 commit f57c6c4

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

src/Differ.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private function getBuffer(array $diff, array $old, $start, $end)
131131
for ($i = $start; $i < $end; $i++) {
132132
if (isset($old[$i])) {
133133
$i = $old[$i];
134-
$buffer = $this->getDiffBufferElementNew($diff, "\n" . $buffer, $i);
134+
$buffer = $this->getDiffBufferElementNew($diff, $buffer, $i);
135135
} else {
136136
$buffer = $this->getDiffBufferElement($diff, $buffer, $i);
137137
}

tests/DifferTest.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,44 @@ public function textProvider()
304304
"A\nB",
305305
"A1\nB",
306306
],
307+
[
308+
<<<EOF
309+
--- Original
310+
+++ New
311+
@@ @@
312+
a
313+
-b
314+
+p
315+
@@ @@
316+
i
317+
-j
318+
+w
319+
k
320+
321+
EOF
322+
,
323+
"a\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk",
324+
"a\np\nc\nd\ne\nf\ng\nh\ni\nw\nk",
325+
],
326+
[
327+
<<<EOF
328+
--- Original
329+
+++ New
330+
@@ @@
331+
a
332+
-b
333+
+p
334+
@@ @@
335+
i
336+
-j
337+
+w
338+
k
339+
340+
EOF
341+
,
342+
"a\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk",
343+
"a\np\nc\nd\ne\nf\ng\nh\ni\nw\nk",
344+
],
307345
];
308346
}
309347

0 commit comments

Comments
 (0)