From 83168301ce72ff45fa89dee9403582cfe76dd3b5 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Wed, 23 Oct 2019 13:36:16 -0400 Subject: [PATCH] Make digits red --- src/Editor.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Editor.php b/src/Editor.php index d1f122d..a71d0e0 100644 --- a/src/Editor.php +++ b/src/Editor.php @@ -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