Added code indentation.
This commit is contained in:
parent
80ce87009e
commit
7d80632557
@ -113,7 +113,8 @@ class IDF_Diff
|
||||
} else {
|
||||
$class = 'diff-a';
|
||||
}
|
||||
$out .= sprintf('<tr class="diff-line"><td class="diff-lc">%s</td><td class="diff-lc">%s</td><td class="%s mono">%s</td></tr>'."\n", $line[0], $line[1], $class, Pluf_esc($line[2]));
|
||||
$line_content = $this->padLine(Pluf_esc($line[2]));
|
||||
$out .= sprintf('<tr class="diff-line"><td class="diff-lc">%s</td><td class="diff-lc">%s</td><td class="%s mono">%s</td></tr>'."\n", $line[0], $line[1], $class, $line_content);
|
||||
}
|
||||
if (count($file['chunks']) > $cc)
|
||||
$out .= '<tr class="diff-next"><td>...</td><td>...</td><td> </td></tr>'."\n";
|
||||
@ -124,6 +125,18 @@ class IDF_Diff
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
public function padLine($line)
|
||||
{
|
||||
$n = strlen($line);
|
||||
for ($i=0;$i<$n;$i++) {
|
||||
if (substr($line, $i, 1) != ' ') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return str_repeat(' ', $i).substr($line, $i);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array array(array(start, n), array(start, n))
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user