diff options
| author | Sinh Pham <phamansinh@gmail.com> | 2015-12-31 15:02:44 -0800 |
|---|---|---|
| committer | Sinh Pham <phamansinh@gmail.com> | 2016-01-01 09:14:39 -0800 |
| commit | 122fc4bc654ff80fa4e58f6a3ee26284fd822213 (patch) | |
| tree | fd0b3531a5250c971789ff8ab967fb52fe1b9cde /src/rustfmt_diff.rs | |
| parent | 0698f0255a1895460b0f497dd17b2ab809529d0a (diff) | |
Fixed #700, use default color for titles and context in write-mode=diff
Diffstat (limited to 'src/rustfmt_diff.rs')
| -rw-r--r-- | src/rustfmt_diff.rs | 6 |
1 files 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<F>(diff: Vec<Mismatch>, 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<F>(diff: Vec<Mismatch>, get_section_title: F) } } } + t.reset().unwrap(); } - t.reset().unwrap(); } |
