Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 77a3f08

Browse files
Merge pull request #73 from Muscraft/rustc-colors
fix: Match rustc's colors
2 parents 4678730 + 49ef459 commit 77a3f08

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

‎src/renderer/mod.rs‎

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,30 @@ impl Renderer {
6262

6363
/// Default terminal styling
6464
pub const fn styled() -> Self {
65+
const BRIGHT_BLUE: Style = if cfg!(windows) {
66+
AnsiColor::BrightCyan.on_default()
67+
} else {
68+
AnsiColor::BrightBlue.on_default()
69+
};
6570
Self {
6671
stylesheet: Stylesheet {
6772
error: AnsiColor::BrightRed.on_default().effects(Effects::BOLD),
68-
warning: AnsiColor::BrightYellow.on_default().effects(Effects::BOLD),
69-
info: AnsiColor::BrightBlue.on_default().effects(Effects::BOLD),
70-
note: Style::new().effects(Effects::BOLD),
73+
warning: if cfg!(windows) {
74+
AnsiColor::BrightYellow.on_default()
75+
} else {
76+
AnsiColor::Yellow.on_default()
77+
}
78+
.effects(Effects::BOLD),
79+
info: BRIGHT_BLUE.effects(Effects::BOLD),
80+
note: AnsiColor::BrightGreen.on_default().effects(Effects::BOLD),
7181
help: AnsiColor::BrightCyan.on_default().effects(Effects::BOLD),
72-
line_no: AnsiColor::BrightBlue.on_default().effects(Effects::BOLD),
73-
emphasis: Style::new().effects(Effects::BOLD),
82+
line_no: BRIGHT_BLUE.effects(Effects::BOLD),
83+
emphasis: if cfg!(windows) {
84+
AnsiColor::BrightWhite.on_default()
85+
} else {
86+
Style::new()
87+
}
88+
.effects(Effects::BOLD),
7489
none: Style::new(),
7590
},
7691
..Self::plain()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /