Skip to content

Commit b02987f

Browse files
committed
Better operator highlighting
1 parent dcdbc24 commit b02987f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ object SyntaxHighlighting {
3838
private def typeDef(str: String) = TypeColor + str + NoColor
3939
private def literal(str: String) = LiteralColor + str + NoColor
4040
private def valDef(str: String) = ValDefColor + str + NoColor
41+
private def operator(str: String) = TypeColor + str + NoColor
4142
private def annotation(str: String) =
4243
if (str.trim == "@") str else AnnotationColor + str + NoColor
4344
private val tripleQs = Console.RED_B + "???" + NoColor
@@ -113,13 +114,13 @@ object SyntaxHighlighting {
113114
}
114115
} else newBuf += '/'
115116
case '=' =>
116-
append('=', _ == "=>", keyword)
117+
append('=', _ == "=>", operator)
117118
case '<' =>
118-
append('<', { x => x == "<-" || x == "<:" || x == "<%" }, keyword)
119+
append('<', { x => x == "<-" || x == "<:" || x == "<%" }, operator)
119120
case '>' =>
120-
append('>', { x => x == ">:" }, keyword)
121+
append('>', { x => x == ">:" }, operator)
121122
case '#' =>
122-
if (prev != ' ' && prev != '.') newBuf append keyword("#")
123+
if (prev != ' ' && prev != '.') newBuf append operator("#")
123124
else newBuf += n
124125
prev = '#'
125126
case '@' =>

0 commit comments

Comments
 (0)