Skip to content

Commit aaba401

Browse files
committed
Respect -color:never with typedef in REPL
1 parent ada17fc commit aaba401

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/src/dotty/tools/repl/ReplDriver.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,12 @@ class ReplDriver(settings: Array[String],
286286
.foreach { sym =>
287287
// FIXME syntax highlighting on comment is currently not working
288288
// out.println(SyntaxHighlighting.highlight("// defined " + sym.showUser))
289-
out.println(SyntaxHighlighting.CommentColor + "// defined " + sym.showUser + SyntaxHighlighting.NoColor)
289+
val message = "// defined " + sym.showUser
290+
if (ctx.settings.color.value != "never") {
291+
println(SyntaxHighlighting.CommentColor + message + SyntaxHighlighting.NoColor)
292+
} else {
293+
println(message)
294+
}
290295
}
291296

292297

0 commit comments

Comments
 (0)