Fixed bug in the diff display when a single empty line was removed.

This commit is contained in:
Loic d'Anterroches
2009-02-02 21:42:31 +01:00
parent d594b3412a
commit b7d1afb01e
3 changed files with 72 additions and 1 deletions

View File

@@ -110,6 +110,12 @@ class IDF_Diff
$lline++;
continue;
}
if ($line == '') {
$files[$current_file]['chunks'][$current_chunk-1][] = array($lline, $rline, $line);
$rline++;
$lline++;
continue;
}
}
$this->files = $files;
return $files;
@@ -243,7 +249,8 @@ class IDF_Diff
for ($lc=$spans[$i][0];$lc<$chunk[0][0];$lc++) {
$exists = false;
foreach ($chunk_lines as $line) {
if ($lc == $line[0] or ($chunk[0][1]-$chunk[0][0]+$lc) == $line[1]) {
if ($lc == $line[0]
or ($chunk[0][1]-$chunk[0][0]+$lc) == $line[1]) {
$exists = true;
break;
}