diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-05-12 14:26:16 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-05-12 14:26:16 +0200 |
commit | dc36755731c92771647531427e390076e558567d (patch) | |
tree | 03e7cea4c0bf8a1487a8b03ccd0f98bb06254376 /src/dotty/tools/dotc/repl/CompilingInterpreter.scala | |
parent | fdf24243ffa07bdcef94032234d36170363bd8bb (diff) | |
download | dotty-dc36755731c92771647531427e390076e558567d.tar.gz dotty-dc36755731c92771647531427e390076e558567d.tar.bz2 dotty-dc36755731c92771647531427e390076e558567d.zip |
Add CLI option to disable REPL syntax highlighting
Diffstat (limited to 'src/dotty/tools/dotc/repl/CompilingInterpreter.scala')
-rw-r--r-- | src/dotty/tools/dotc/repl/CompilingInterpreter.scala | 9 |
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) |