From f1cc4f2a0c536989402c5ff667d3425e7a6e169d Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Tue, 20 Sep 2016 09:50:47 +0200 Subject: Better operator highlighting --- src/dotty/tools/dotc/printing/SyntaxHighlighting.scala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala b/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala index cdb81d540..6ad29946a 100644 --- a/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala +++ b/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala @@ -38,6 +38,7 @@ object SyntaxHighlighting { private def typeDef(str: String) = TypeColor + str + NoColor private def literal(str: String) = LiteralColor + str + NoColor private def valDef(str: String) = ValDefColor + str + NoColor + private def operator(str: String) = TypeColor + str + NoColor private def annotation(str: String) = if (str.trim == "@") str else AnnotationColor + str + NoColor private val tripleQs = Console.RED_B + "???" + NoColor @@ -113,13 +114,13 @@ object SyntaxHighlighting { } } else newBuf += '/' case '=' => - append('=', _ == "=>", keyword) + append('=', _ == "=>", operator) case '<' => - append('<', { x => x == "<-" || x == "<:" || x == "<%" }, keyword) + append('<', { x => x == "<-" || x == "<:" || x == "<%" }, operator) case '>' => - append('>', { x => x == ">:" }, keyword) + append('>', { x => x == ">:" }, operator) case '#' => - if (prev != ' ' && prev != '.') newBuf append keyword("#") + if (prev != ' ' && prev != '.') newBuf append operator("#") else newBuf += n prev = '#' case '@' => -- cgit v1.2.3