Skip to content

Commit

Permalink
Special case a few colors for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Turner committed Aug 31, 2016
1 parent 7a187c3 commit 1b04762
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
15 changes: 13 additions & 2 deletions src/librustc_errors/emitter.rs
Expand Up @@ -883,7 +883,11 @@ impl Destination {
Style::FileNameStyle | Style::LineAndColumn => {}
Style::LineNumber => {
try!(self.start_attr(term::Attr::Bold));
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE)));
if cfg!(windows) {
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_CYAN)));
} else {
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE)));
}
}
Style::ErrorCode => {
try!(self.start_attr(term::Attr::Bold));
Expand All @@ -896,6 +900,9 @@ impl Destination {
}
Style::OldSchoolNoteText | Style::HeaderMsg => {
try!(self.start_attr(term::Attr::Bold));
if cfg!(windows) {
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_WHITE)));
}
}
Style::UnderlinePrimary | Style::LabelPrimary => {
try!(self.start_attr(term::Attr::Bold));
Expand All @@ -904,7 +911,11 @@ impl Destination {
Style::UnderlineSecondary |
Style::LabelSecondary => {
try!(self.start_attr(term::Attr::Bold));
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE)));
if cfg!(windows) {
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_CYAN)));
} else {
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE)));
}
}
Style::NoStyle => {}
Style::Level(l) => {
Expand Down
8 changes: 7 additions & 1 deletion src/librustc_errors/lib.rs
Expand Up @@ -732,7 +732,13 @@ impl Level {
pub fn color(self) -> term::color::Color {
match self {
Bug | Fatal | PhaseFatal | Error => term::color::BRIGHT_RED,
Warning => term::color::YELLOW,
Warning => {
if cfg!(windows) {
term::color::BRIGHT_YELLOW
} else {
term::color::YELLOW
}
},
Note => term::color::BRIGHT_GREEN,
Help => term::color::BRIGHT_CYAN,
Cancelled => unreachable!(),
Expand Down

0 comments on commit 1b04762

Please sign in to comment.