diff --git a/src/formattedtext.rs b/src/formattedtext.rs index 0c1bf46..68de1ef 100644 --- a/src/formattedtext.rs +++ b/src/formattedtext.rs @@ -61,10 +61,12 @@ fn format_map_ansi(c: char) -> Option { } +// style::reset also resets color. +// Make sure color comes AFTER style reset. fn format_map_full(c: char) -> Option { Some(match c { 'n' => { // Normal text - format!("{}{}", color::Fg(color::Reset), style::Reset) + format!("{}{}", style::Reset, color::Fg(color::Reset)) }, 'i' => { // Normal italic text format!("{}{}", color::Fg(color::Reset), style::Italic) @@ -73,7 +75,7 @@ fn format_map_full(c: char) -> Option { format!("{}{}", color::Fg(color::Magenta), style::Bold) }, 'a' => { // Colored text - format!("{}{}", color::Fg(color::Magenta), style::Reset) + format!("{}{}", style::Reset, color::Fg(color::Magenta)) }, 'e' => { // Error titles format!("{}{}", color::Fg(color::Red), style::Bold)