From dc36755731c92771647531427e390076e558567d Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Thu, 12 May 2016 14:26:16 +0200 Subject: Add CLI option to disable REPL syntax highlighting --- src/dotty/tools/dotc/repl/CompilingInterpreter.scala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/dotty/tools/dotc/repl/CompilingInterpreter.scala') 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) -- cgit v1.2.3