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:
2019-03-04 13:58:50 +00:00
parent a46665a91c
commit fbb7991a1f

View File

@@ -450,6 +450,8 @@ class xdiff
$symbol = null;
$side1 = mb_substr (rtrim ($side1), 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;
$nbtabs = floor ((1 + $this->s2sWidth - mb_strlen ($side1)) / 8);
if ($symbol !== null || $side2 !== "")
@@ -459,7 +461,12 @@ class xdiff
elseif ($symbol !== null)
{
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;
}
if ($symbol !== null && $side2 !== "")