Skip to content

Commit ab34a1a

Browse files
committed
add terminal color
1 parent 299c6ad commit ab34a1a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

stringify.mbt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ let output_colorful_text_for_terminal : Ref[Bool] = Ref::new(false)
9494
fn Array::push_line(self : Array[String], tag : String, line : String) -> Unit {
9595
let tagged_line = "\{tag}\{line}"
9696
if output_colorful_text_for_terminal.val {
97-
...
97+
match tag {
98+
"+" => self.push("\u001B[32m\{tagged_line}\u001B[39m") // Green
99+
"-" => self.push("\u001B[31m\{tagged_line}\u001B[39m") // Red
100+
_ => self.push(tagged_line)
101+
}
98102
} else {
99103
self.push(tagged_line)
100104
}

0 commit comments

Comments
 (0)