aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/repl/CompilingInterpreter.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/repl/CompilingInterpreter.scala')
-rw-r--r--src/dotty/tools/dotc/repl/CompilingInterpreter.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/repl/CompilingInterpreter.scala b/src/dotty/tools/dotc/repl/CompilingInterpreter.scala
index fd16bc481..7de7a4bd6 100644
--- a/src/dotty/tools/dotc/repl/CompilingInterpreter.scala
+++ b/src/dotty/tools/dotc/repl/CompilingInterpreter.scala
@@ -418,11 +418,12 @@ class CompilingInterpreter(out: PrintWriter, ictx: Context) extends Compiler wit
try {
withOutput(new ByteOutputStream) { ps =>
val rawRes = valMethodRes.invoke(interpreterResultObject).toString
- val res = new String(SyntaxHighlighting(rawRes).toArray)
+ val res =
+ if (!ictx.settings.XreplNoColor.value)
+ new String(SyntaxHighlighting(rawRes).toArray)
+ else rawRes
val prints = ps.toString("utf-8")
- val printList =
- if (prints == "") Nil
- else prints :: Nil
+ val printList = if (prints != "") prints :: Nil else Nil
if (!delayOutput) out.print(prints)