summaryrefslogtreecommitdiff
blob: 026503e8f2c97bf7e145bf9aa46792f43eb8e670 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--- /usr/bin/colorgcc	2009-10-29 20:24:46.717190000 +0100
+++ colorgcc	2009-10-29 20:27:42.614162888 +0100
@@ -102,7 +102,8 @@
    $nocolor{"dumb"} = "true";
 
    $colors{"srcColor"} = color("cyan");
-   $colors{"introColor"} = color("blue");
+   $colors{"introFileNameColor"} = color("blue");
+   $colors{"introMessageColor"} = color("blue");
 
    $colors{"warningFileNameColor"} = color("yellow");
    $colors{"warningNumberColor"}   = color("yellow");
@@ -111,6 +112,10 @@
    $colors{"errorFileNameColor"} = color("bold red");
    $colors{"errorNumberColor"}   = color("bold red");
    $colors{"errorMessageColor"}  = color("bold red");
+
+   $colors{"noteFileNameColor"} = color("green");
+   $colors{"noteNumberColor"}   = color("green");
+   $colors{"noteMessageColor"}  = color("green");
 }
 
 sub loadPreferences
@@ -290,12 +295,18 @@
 	 print($colors{"warningNumberColor"}, "$field2:", color("reset"));
 	 srcscan($field3, $colors{"warningMessageColor"});
       }
-      else 
-      {
+      elsif ($field3 =~ m/\s+error:.*/)
+	{
 	 # Error
 	 print($colors{"errorFileNameColor"}, "$field1:", color("reset"));
 	 print($colors{"errorNumberColor"}, "$field2:", color("reset"));
 	 srcscan($field3, $colors{"errorMessageColor"});
+      } else
+      {
+	 # Note
+	 print($colors{"noteFileNameColor"}, "$field1:", color("reset"));
+	 print($colors{"noteNumberColor"}, "$field2:", color("reset"));
+	 srcscan($field3, $colors{"noteMessageColor"});
       }
       print("\n");
    }
@@ -305,8 +316,11 @@
    }
    elsif (m/^(.*?):(.+):$/) # filename:message:
    {
+      my $field1 = $1 || "";
+      my $field2 = $2 || "";
       # No line number, treat as an "introductory" line of text.
-      srcscan($_, $colors{"introColor"});
+	 print($colors{"introFileNameColor"}, "$field1:", color("reset"));
+	 print($colors{"introMessageColor"}, "$field2:\n", color("reset"));
    }
    else # Anything else.
    {