mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
Add color_reset to StyleCodes
This commit is contained in:
parent
928f99957a
commit
e2ea66043a
2 changed files with 4 additions and 0 deletions
|
@ -61,6 +61,7 @@ mod cli_run {
|
||||||
.replace(ANSI_STYLE_CODES.bold, "")
|
.replace(ANSI_STYLE_CODES.bold, "")
|
||||||
.replace(ANSI_STYLE_CODES.underline, "")
|
.replace(ANSI_STYLE_CODES.underline, "")
|
||||||
.replace(ANSI_STYLE_CODES.reset, "")
|
.replace(ANSI_STYLE_CODES.reset, "")
|
||||||
|
.replace(ANSI_STYLE_CODES.color_reset, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_compile_error(file: &Path, flags: &[&str], expected: &str) {
|
fn check_compile_error(file: &Path, flags: &[&str], expected: &str) {
|
||||||
|
|
|
@ -215,6 +215,7 @@ pub struct StyleCodes {
|
||||||
pub bold: &'static str,
|
pub bold: &'static str,
|
||||||
pub underline: &'static str,
|
pub underline: &'static str,
|
||||||
pub reset: &'static str,
|
pub reset: &'static str,
|
||||||
|
pub color_reset: &'static str,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const ANSI_STYLE_CODES: StyleCodes = StyleCodes {
|
pub const ANSI_STYLE_CODES: StyleCodes = StyleCodes {
|
||||||
|
@ -228,6 +229,7 @@ pub const ANSI_STYLE_CODES: StyleCodes = StyleCodes {
|
||||||
bold: "\u{001b}[1m",
|
bold: "\u{001b}[1m",
|
||||||
underline: "\u{001b}[4m",
|
underline: "\u{001b}[4m",
|
||||||
reset: "\u{001b}[0m",
|
reset: "\u{001b}[0m",
|
||||||
|
color_reset: "\u{1b}[39m",
|
||||||
};
|
};
|
||||||
|
|
||||||
macro_rules! html_color {
|
macro_rules! html_color {
|
||||||
|
@ -247,6 +249,7 @@ pub const HTML_STYLE_CODES: StyleCodes = StyleCodes {
|
||||||
bold: "<span style='font-weight: bold'>",
|
bold: "<span style='font-weight: bold'>",
|
||||||
underline: "<span style='text-decoration: underline'>",
|
underline: "<span style='text-decoration: underline'>",
|
||||||
reset: "</span>",
|
reset: "</span>",
|
||||||
|
color_reset: "</span>",
|
||||||
};
|
};
|
||||||
|
|
||||||
// define custom allocator struct so we can `impl RocDocAllocator` custom helpers
|
// define custom allocator struct so we can `impl RocDocAllocator` custom helpers
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue