@@ -10,7 +10,7 @@ use typos_cli::report::{Context, Message, Report, Typo};
1010
1111const ERROR : anstyle:: Style = anstyle:: AnsiColor :: BrightRed . on_default ( ) ;
1212const INFO : anstyle:: Style = anstyle:: AnsiColor :: BrightBlue . on_default ( ) ;
13- const STRONG : anstyle:: Style = anstyle:: Style :: new ( ) . effects ( anstyle :: Effects :: BOLD ) ;
13+ const GOOD : anstyle:: Style = anstyle:: AnsiColor :: BrightGreen . on_default ( ) ;
1414
1515pub struct MessageStatus < ' r > {
1616 typos_found : atomic:: AtomicBool ,
@@ -126,8 +126,9 @@ impl Report for PrintLong {
126126}
127127
128128fn print_brief_correction ( msg : & Typo ) -> Result < ( ) , std:: io:: Error > {
129+ let error = ERROR . render ( ) ;
130+ let good = GOOD . render ( ) ;
129131 let info = INFO . render ( ) ;
130- let strong = STRONG . render ( ) ;
131132 let reset = anstyle:: Reset . render ( ) ;
132133
133134 let start = String :: from_utf8_lossy ( & msg. buffer [ 0 ..msg. byte_offset ] ) ;
@@ -139,7 +140,7 @@ fn print_brief_correction(msg: &Typo) -> Result<(), std::io::Error> {
139140 let divider = ":" ;
140141 writeln ! (
141142 stdout( ) . lock( ) ,
142- "{info}{}{divider}{column_number}{reset}: {strong}`{} ` is disallowed{reset} " ,
143+ "{info}{}{divider}{column_number}{reset}: `{error}{}{reset} ` is disallowed" ,
143144 context_display( & msg. context) ,
144145 msg. typo,
145146 ) ?;
@@ -148,10 +149,13 @@ fn print_brief_correction(msg: &Typo) -> Result<(), std::io::Error> {
148149 let divider = ":" ;
149150 writeln ! (
150151 stdout( ) . lock( ) ,
151- "{info}{}{divider}{column_number}{reset}: {strong}`{} ` -> {}{reset }" ,
152+ "{info}{}{divider}{column_number}{reset}: `{error}{}{reset} ` -> {}" ,
152153 context_display( & msg. context) ,
153154 msg. typo,
154- itertools:: join( corrections. iter( ) . map( |s| format!( "`{}`" , s) ) , ", " )
155+ itertools:: join(
156+ corrections. iter( ) . map( |s| format!( "`{good}{}{reset}`" , s) ) ,
157+ ", "
158+ )
155159 ) ?;
156160 }
157161 }
@@ -161,8 +165,8 @@ fn print_brief_correction(msg: &Typo) -> Result<(), std::io::Error> {
161165
162166fn print_long_correction ( msg : & Typo ) -> Result < ( ) , std:: io:: Error > {
163167 let error = ERROR . render ( ) ;
168+ let good = GOOD . render ( ) ;
164169 let info = INFO . render ( ) ;
165- let strong = STRONG . render ( ) ;
166170 let reset = anstyle:: Reset . render ( ) ;
167171
168172 let stdout = stdout ( ) ;
@@ -178,16 +182,19 @@ fn print_long_correction(msg: &Typo) -> Result<(), std::io::Error> {
178182 typos:: Status :: Invalid => {
179183 writeln ! (
180184 handle,
181- "{error}error{reset}: {strong}`{} ` is disallowed{reset} " ,
185+ "{error}error{reset}: `{error}{}{reset} ` is disallowed" ,
182186 msg. typo,
183187 ) ?;
184188 }
185189 typos:: Status :: Corrections ( corrections) => {
186190 writeln ! (
187191 handle,
188- "{error}error{reset}: {strong}`{} ` should be {}{reset }" ,
192+ "{error}error{reset}: `{error}{}{reset} ` should be {}" ,
189193 msg. typo,
190- itertools:: join( corrections. iter( ) . map( |s| format!( "`{}`" , s) ) , ", " )
194+ itertools:: join(
195+ corrections. iter( ) . map( |s| format!( "`{good}{}{reset}`" , s) ) ,
196+ ", "
197+ )
191198 ) ?;
192199 }
193200 }
0 commit comments