Fix handling of spaces between language, switches, and parameters.

This commit is contained in:
Tom Alexander
2023-10-04 18:57:51 -04:00
parent 8e70773b15
commit c877116540
3 changed files with 31 additions and 48 deletions

View File

@@ -235,7 +235,7 @@ impl<'b, 's> DiffResult<'b, 's> {
.any(|child| child.is_immediately_bad() || child.has_bad_children())
}
fn foreground_color(red: u8, green: u8, blue: u8) -> String {
pub(crate) fn foreground_color(red: u8, green: u8, blue: u8) -> String {
if DiffResult::should_use_color() {
format!(
"\x1b[38;2;{red};{green};{blue}m",
@@ -249,7 +249,7 @@ impl<'b, 's> DiffResult<'b, 's> {
}
#[allow(dead_code)]
fn background_color(red: u8, green: u8, blue: u8) -> String {
pub(crate) fn background_color(red: u8, green: u8, blue: u8) -> String {
if DiffResult::should_use_color() {
format!(
"\x1b[48;2;{red};{green};{blue}m",
@@ -262,7 +262,7 @@ impl<'b, 's> DiffResult<'b, 's> {
}
}
fn reset_color() -> &'static str {
pub(crate) fn reset_color() -> &'static str {
if DiffResult::should_use_color() {
"\x1b[0m"
} else {