Skip to content

Commit 7f066a2

Browse files
SpacePossumsebastianbergmann
authored andcommitted
Do no add an empty line before every header.
1 parent 3c7d219 commit 7f066a2

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
@@ -135,7 +135,7 @@ private function getBuffer(array $diff, array $old, $start, $end)
135135
for ($i = $start; $i < $end; $i++) {
136136
if (isset($old[$i])) {
137137
$i = $old[$i];
138-
$buffer = $this->getDiffBufferElementNew($diff, "\n" . $buffer, $i);
138+
$buffer = $this->getDiffBufferElementNew($diff, $buffer, $i);
139139
} else {
140140
$buffer = $this->getDiffBufferElement($diff, $buffer, $i);
141141
}

tests/DifferTest.php

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

0 commit comments

Comments
 (0)