aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/repl/AmmoniteReader.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/repl/AmmoniteReader.scala')
-rw-r--r--src/dotty/tools/dotc/repl/AmmoniteReader.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/repl/AmmoniteReader.scala b/src/dotty/tools/dotc/repl/AmmoniteReader.scala
index 508257e44..c02a14451 100644
--- a/src/dotty/tools/dotc/repl/AmmoniteReader.scala
+++ b/src/dotty/tools/dotc/repl/AmmoniteReader.scala
@@ -58,8 +58,10 @@ class AmmoniteReader(val interpreter: Interpreter)(implicit ctx: Context) extend
allFilters,
displayTransform = (buffer, cursor) => {
val coloredBuffer =
- if (!ctx.settings.XreplNoColor.value) SyntaxHighlighting(buffer)
+ if (List("auto", "always").contains(ctx.settings.color.value))
+ SyntaxHighlighting(buffer)
else buffer
+
val ansiBuffer = Ansi.Str.parse(coloredBuffer)
val (newBuffer, cursorOffset) = SelectionFilter.mangleBuffer(
selectionFilter, ansiBuffer, cursor, Ansi.Reversed.On