Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match TypeScript & JavaScript error colors #1793

Merged
merged 2 commits into from
Feb 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/ansi.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use ansi_term::Color::Cyan;
use ansi_term::Color::Fixed;
use ansi_term::Color::Red;
use ansi_term::Color::Yellow;
use ansi_term::Style;
use regex::Regex;
use std::borrow::Cow;
Expand Down Expand Up @@ -47,15 +46,17 @@ pub fn italic_bold(s: String) -> impl fmt::Display {
pub fn yellow(s: String) -> impl fmt::Display {
let mut style = Style::new();
if use_color() {
style = style.fg(Yellow);
// matches TypeScript's ForegroundColorEscapeSequences.Yellow
style = style.fg(Fixed(11));
}
style.paint(s)
}

pub fn cyan(s: String) -> impl fmt::Display {
let mut style = Style::new();
if use_color() {
style = style.fg(Cyan);
// matches TypeScript's ForegroundColorEscapeSequences.Cyan
style = style.fg(Fixed(14));
}
style.paint(s)
}
Expand Down