Complete step 176

This commit is contained in:
Timothy Warren 2019-10-25 15:34:56 -04:00
parent 2bc98b0308
commit e6dc670c1d
1 changed files with 15 additions and 1 deletions

View File

@ -528,7 +528,21 @@ class Editor {
for ($i = 0; $i < $len; $i++)
{
if ($hl[$i] === Highlight::NORMAL)
// Handle 'non-printable' characters
if (is_cntrl($c[$i]))
{
$sym = (ord($c[$i]) <= 26)
? chr(ord('@') + ord($c[$i]))
: '?';
$this->ab .= "\x1b[7m";
$this->ab .= $sym;
$this->ab .= "\x1b[m";
if ($currentColor !== -1)
{
$this->ab .= sprintf("\x1b%dm", $currentColor);
}
}
else if ($hl[$i] === Highlight::NORMAL)
{
if ($currentColor !== -1)
{