@@ -10,7 +10,7 @@ use typos_cli::report::{Context, Message, Report, Typo};
10
10
11
11
const ERROR : anstyle:: Style = anstyle:: AnsiColor :: BrightRed . on_default ( ) ;
12
12
const 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 ( ) ;
14
14
15
15
pub struct MessageStatus < ' r > {
16
16
typos_found : atomic:: AtomicBool ,
@@ -126,8 +126,9 @@ impl Report for PrintLong {
126
126
}
127
127
128
128
fn print_brief_correction ( msg : & Typo ) -> Result < ( ) , std:: io:: Error > {
129
+ let error = ERROR . render ( ) ;
130
+ let good = GOOD . render ( ) ;
129
131
let info = INFO . render ( ) ;
130
- let strong = STRONG . render ( ) ;
131
132
let reset = anstyle:: Reset . render ( ) ;
132
133
133
134
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> {
139
140
let divider = ":" ;
140
141
writeln ! (
141
142
stdout( ) . lock( ) ,
142
- "{info}{}{divider}{column_number}{reset}: {strong}`{} ` is disallowed{reset} " ,
143
+ "{info}{}{divider}{column_number}{reset}: `{error}{}{reset} ` is disallowed" ,
143
144
context_display( & msg. context) ,
144
145
msg. typo,
145
146
) ?;
@@ -148,10 +149,13 @@ fn print_brief_correction(msg: &Typo) -> Result<(), std::io::Error> {
148
149
let divider = ":" ;
149
150
writeln ! (
150
151
stdout( ) . lock( ) ,
151
- "{info}{}{divider}{column_number}{reset}: {strong}`{} ` -> {}{reset }" ,
152
+ "{info}{}{divider}{column_number}{reset}: `{error}{}{reset} ` -> {}" ,
152
153
context_display( & msg. context) ,
153
154
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
+ )
155
159
) ?;
156
160
}
157
161
}
@@ -161,8 +165,8 @@ fn print_brief_correction(msg: &Typo) -> Result<(), std::io::Error> {
161
165
162
166
fn print_long_correction ( msg : & Typo ) -> Result < ( ) , std:: io:: Error > {
163
167
let error = ERROR . render ( ) ;
168
+ let good = GOOD . render ( ) ;
164
169
let info = INFO . render ( ) ;
165
- let strong = STRONG . render ( ) ;
166
170
let reset = anstyle:: Reset . render ( ) ;
167
171
168
172
let stdout = stdout ( ) ;
@@ -178,16 +182,19 @@ fn print_long_correction(msg: &Typo) -> Result<(), std::io::Error> {
178
182
typos:: Status :: Invalid => {
179
183
writeln ! (
180
184
handle,
181
- "{error}error{reset}: {strong}`{} ` is disallowed{reset} " ,
185
+ "{error}error{reset}: `{error}{}{reset} ` is disallowed" ,
182
186
msg. typo,
183
187
) ?;
184
188
}
185
189
typos:: Status :: Corrections ( corrections) => {
186
190
writeln ! (
187
191
handle,
188
- "{error}error{reset}: {strong}`{} ` should be {}{reset }" ,
192
+ "{error}error{reset}: `{error}{}{reset} ` should be {}" ,
189
193
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
+ )
191
198
) ?;
192
199
}
193
200
}
0 commit comments