From e2ea66043a1c52d2a8d114d7f77c2066be1566a3 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Wed, 20 Apr 2022 18:13:18 -0400 Subject: [PATCH] Add color_reset to StyleCodes --- cli/tests/cli_run.rs | 1 + reporting/src/report.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/cli/tests/cli_run.rs b/cli/tests/cli_run.rs index 32ef62de18..989f0054c4 100644 --- a/cli/tests/cli_run.rs +++ b/cli/tests/cli_run.rs @@ -61,6 +61,7 @@ mod cli_run { .replace(ANSI_STYLE_CODES.bold, "") .replace(ANSI_STYLE_CODES.underline, "") .replace(ANSI_STYLE_CODES.reset, "") + .replace(ANSI_STYLE_CODES.color_reset, "") } fn check_compile_error(file: &Path, flags: &[&str], expected: &str) { diff --git a/reporting/src/report.rs b/reporting/src/report.rs index a97537e18c..c3d8204a78 100644 --- a/reporting/src/report.rs +++ b/reporting/src/report.rs @@ -215,6 +215,7 @@ pub struct StyleCodes { pub bold: &'static str, pub underline: &'static str, pub reset: &'static str, + pub color_reset: &'static str, } pub const ANSI_STYLE_CODES: StyleCodes = StyleCodes { @@ -228,6 +229,7 @@ pub const ANSI_STYLE_CODES: StyleCodes = StyleCodes { bold: "\u{001b}[1m", underline: "\u{001b}[4m", reset: "\u{001b}[0m", + color_reset: "\u{1b}[39m", }; macro_rules! html_color { @@ -247,6 +249,7 @@ pub const HTML_STYLE_CODES: StyleCodes = StyleCodes { bold: "", underline: "", reset: "", + color_reset: "", }; // define custom allocator struct so we can `impl RocDocAllocator` custom helpers