Skip to content

Commit 47bfc1d

Browse files
committed
Merge pull request #1 from Atry/patch-1
Fix scala#3814 Correct highlighting after '&' characters in REPL
2 parents 3939df8 + 57f2fe9 commit 47bfc1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ object SyntaxHighlighting {
4444

4545
private val typeEnders =
4646
'{' :: '}' :: ')' :: '(' :: '[' :: ']' :: '=' :: ' ' :: ',' :: '.' :: '|' ::
47-
'\n' :: Nil
47+
:: '&' :: '\n' :: Nil
4848

4949
def apply(chars: Iterable[Char]): Iterable[Char] = {
5050
var prev: Char = 0
@@ -55,7 +55,7 @@ object SyntaxHighlighting {
5555
@inline def keywordStart =
5656
prev == 0 || prev == ' ' || prev == '{' || prev == '(' ||
5757
prev == '\n' || prev == '[' || prev == ',' || prev == ':' ||
58-
prev == '|'
58+
prev == '|' || prev == '&'
5959

6060
@inline def numberStart(c: Char) =
6161
c.isDigit && (!prev.isLetter || prev == '.' || prev == ' ' || prev == '(' || prev == '\u0000')

0 commit comments

Comments
 (0)