@@ -8,8 +8,9 @@ object DiffUtil {
8
8
private final val ANSI_DEFAULT = " \u001B [0m"
9
9
private final val ANSI_RED = " \u001B [31m"
10
10
private final val ANSI_GREEN = " \u001B [32m"
11
- private final val ANSI_YELLOW = " \u001B [33m"
12
- private final val ANSI_MAGENTA = " \u001B [35m"
11
+
12
+ private final val DELETION_COLOR = ANSI_RED
13
+ private final val ADDITION_COLOR = ANSI_GREEN
13
14
14
15
def mkColoredCodeDiff (code : String , lastCode : String , printDiffDel : Boolean ): String = {
15
16
import scala .collection .JavaConversions ._
@@ -42,19 +43,19 @@ object DiffUtil {
42
43
43
44
delta.getType.toString match { // Issue #1355 forces us to use the toString
44
45
case " INSERT" =>
45
- lines(pos) = ANSI_GREEN + lines(pos)
46
+ lines(pos) = ADDITION_COLOR + lines(pos)
46
47
lines(endPos) = lines(endPos) + ANSI_DEFAULT
47
48
48
49
case " CHANGE" =>
49
50
val old = if (! printDiffDel) " " else
50
- ANSI_MAGENTA + delta.getOriginal.getLines.mkString + ANSI_DEFAULT
51
- lines(pos) = old + ANSI_YELLOW + lines(pos)
51
+ DELETION_COLOR + delta.getOriginal.getLines.mkString + ANSI_DEFAULT
52
+ lines(pos) = old + ADDITION_COLOR + lines(pos)
52
53
lines(endPos) = lines(endPos) + ANSI_DEFAULT
53
54
54
55
case " DELETE" if printDiffDel =>
55
56
val deleted = delta.getOriginal.getLines.mkString
56
57
if (! deleted.forall(Character .isWhitespace)) {
57
- lines(pos) = ANSI_RED + deleted + ANSI_DEFAULT + lines(pos)
58
+ lines(pos) = DELETION_COLOR + deleted + ANSI_DEFAULT + lines(pos)
58
59
}
59
60
60
61
case _ =>
0 commit comments