Trying to properly handle tabs
This commit is contained in:
parent
c96a08808f
commit
1b002fb0ce
14
bhl.inc.php
14
bhl.inc.php
|
@ -360,7 +360,19 @@ function bhl_clean_cache()
|
|||
function bhl_show_position($line, $row, array $lines)
|
||||
{
|
||||
if($line > 0 && $line <= count($lines))
|
||||
return $lines[$line-1].str_repeat('-', $row)."^";
|
||||
{
|
||||
//handling tabs
|
||||
$hint = str_replace("\t", " ", $lines[$line-1]);
|
||||
for($c=0;$c<$row;++$c)
|
||||
{
|
||||
if($lines[$line-1][$c] === "\t")
|
||||
$hint .= "----";
|
||||
else
|
||||
$hint .= "-";
|
||||
}
|
||||
$hint .= "^";
|
||||
return $hint;
|
||||
}
|
||||
else
|
||||
return "??? @($line:$row)";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue