Make digits red

This commit is contained in:
Timothy Warren 2019-10-23 13:36:16 -04:00
parent bb1ee20964
commit 83168301ce
1 changed files with 15 additions and 1 deletions

View File

@ -660,7 +660,21 @@ class Editor {
$len = $this->screenCols;
}
$this->ab .= substr($this->rows[$filerow]->render, $this->colOffset, $len);
$c = substr($this->rows[$filerow]->render, $this->colOffset, $len);
for ($i = 0; $i < $len; $i++)
{
if (isdigit($c[$i]))
{
$this->ab .= "\x1b[31m";
$this->ab .= $c[$i];
$this->ab .= "\x1b[39m";
}
else
{
$this->ab .= $c[$i];
}
}
}
$this->ab .= "\x1b[K"; // Clear the current line