aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-09-15 11:51:40 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-10-10 13:25:32 +0200
commitd2c9e190070a87f75f5398c90758134269752a90 (patch)
tree1742d3d94d46f304ba59dc140da63763a7f2c9dc /src
parenta6997587fec8e73f28ca3145339ee971aeaa94b2 (diff)
downloaddotty-d2c9e190070a87f75f5398c90758134269752a90.tar.gz
dotty-d2c9e190070a87f75f5398c90758134269752a90.tar.bz2
dotty-d2c9e190070a87f75f5398c90758134269752a90.zip
Return iterable from highlighting function instead of vector
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/printing/SyntaxHighlighting.scala4
-rw-r--r--src/dotty/tools/dotc/repl/AmmoniteReader.scala2
2 files changed, 3 insertions, 3 deletions
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
)