From b846a7c144a475904362c1c924b712dd7234c048 Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 17 Aug 2023 12:49:29 -0700 Subject: [PATCH] Fixed help art --- src/formattedtext.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)