Xdiff : missing calculation if there is not additional tab in side2side
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5079 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -450,6 +450,8 @@ class xdiff
|
|||||||
$symbol = null;
|
$symbol = null;
|
||||||
$side1 = mb_substr (rtrim ($side1), 0, $this->s2sWidth - 1);
|
$side1 = mb_substr (rtrim ($side1), 0, $this->s2sWidth - 1);
|
||||||
$side2 = mb_substr (rtrim ($side2), 0, $this->s2sWidth - 1);
|
$side2 = mb_substr (rtrim ($side2), 0, $this->s2sWidth - 1);
|
||||||
|
$side1 = str_replace ("\t", " ", $side1);
|
||||||
|
$side2 = str_replace ("\t", " ", $side2);
|
||||||
$d .= $side1;
|
$d .= $side1;
|
||||||
$nbtabs = floor ((1 + $this->s2sWidth - mb_strlen ($side1)) / 8);
|
$nbtabs = floor ((1 + $this->s2sWidth - mb_strlen ($side1)) / 8);
|
||||||
if ($symbol !== null || $side2 !== "")
|
if ($symbol !== null || $side2 !== "")
|
||||||
@@ -459,7 +461,12 @@ class xdiff
|
|||||||
elseif ($symbol !== null)
|
elseif ($symbol !== null)
|
||||||
{
|
{
|
||||||
if (mb_strlen ($side1) < $this->s2sWidth - 1)
|
if (mb_strlen ($side1) < $this->s2sWidth - 1)
|
||||||
$d .= str_repeat (" ", 5);
|
{
|
||||||
|
if ($nbtabs > 1)
|
||||||
|
$d .= str_repeat (" ", 5);
|
||||||
|
else
|
||||||
|
$d .= str_repeat (" ", $this->s2sWidth - mb_strlen ($side1) - 1);
|
||||||
|
}
|
||||||
$d .= " ".$symbol;
|
$d .= " ".$symbol;
|
||||||
}
|
}
|
||||||
if ($symbol !== null && $side2 !== "")
|
if ($symbol !== null && $side2 !== "")
|
||||||
|
|||||||
Reference in New Issue
Block a user