From 122fc4bc654ff80fa4e58f6a3ee26284fd822213 Mon Sep 17 00:00:00 2001 From: Sinh Pham Date: Thu, 31 Dec 2015 15:02:44 -0800 Subject: [PATCH] Fixed #700, use default color for titles and context in write-mode=diff --- src/rustfmt_diff.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rustfmt_diff.rs b/src/rustfmt_diff.rs index 4bb858a6b30..9f529276df1 100644 --- a/src/rustfmt_diff.rs +++ b/src/rustfmt_diff.rs @@ -88,15 +88,15 @@ pub fn print_diff(diff: Vec, get_section_title: F) where F: Fn(u32) -> String { let mut t = term::stdout().unwrap(); + for mismatch in diff { - t.fg(term::color::BRIGHT_WHITE).unwrap(); let title = get_section_title(mismatch.line_number); writeln!(t, "{}", title).unwrap(); for line in mismatch.lines { match line { DiffLine::Context(ref str) => { - t.fg(term::color::WHITE).unwrap(); + t.reset().unwrap(); writeln!(t, " {}⏎", str).unwrap(); } DiffLine::Expected(ref str) => { @@ -109,6 +109,6 @@ pub fn print_diff(diff: Vec, get_section_title: F) } } } + t.reset().unwrap(); } - t.reset().unwrap(); }