From d2c9e190070a87f75f5398c90758134269752a90 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Thu, 15 Sep 2016 11:51:40 +0200 Subject: Return iterable from highlighting function instead of vector --- src/dotty/tools/dotc/printing/SyntaxHighlighting.scala | 4 ++-- src/dotty/tools/dotc/repl/AmmoniteReader.scala | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala b/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala index 932b980db..c933dd0b9 100644 --- a/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala +++ b/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala @@ -51,7 +51,7 @@ object SyntaxHighlighting { private val typeEnders = '{' :: '}' :: ')' :: '(' :: '=' :: ' ' :: ',' :: '.' :: '\n' :: Nil - def apply(chars: Iterable[Char]): Vector[Char] = { + def apply(chars: Iterable[Char]): Iterable[Char] = { var prev: Char = 0 var remaining = chars.toStream val newBuf = new StringBuilder @@ -281,6 +281,6 @@ object SyntaxHighlighting { prev = curr } - newBuf.toVector + newBuf.toIterable } } diff --git a/src/dotty/tools/dotc/repl/AmmoniteReader.scala b/src/dotty/tools/dotc/repl/AmmoniteReader.scala index 614654a28..435269081 100644 --- a/src/dotty/tools/dotc/repl/AmmoniteReader.scala +++ b/src/dotty/tools/dotc/repl/AmmoniteReader.scala @@ -61,7 +61,7 @@ class AmmoniteReader(val interpreter: Interpreter)(implicit ctx: Context) extend if (ctx.useColors) SyntaxHighlighting(buffer) else buffer - val ansiBuffer = Ansi.Str.parse(coloredBuffer) + val ansiBuffer = Ansi.Str.parse(coloredBuffer.toVector) val (newBuffer, cursorOffset) = SelectionFilter.mangleBuffer( selectionFilter, ansiBuffer, cursor, Ansi.Reversed.On ) -- cgit v1.2.3