File tree 2 files changed +9
-11
lines changed
compiler/rustc_errors/src
2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -1679,15 +1679,14 @@ impl EmitterWriter {
1679
1679
// Colorize addition/replacements with green.
1680
1680
for & SubstitutionHighlight { start, end } in highlight_parts {
1681
1681
// Account for tabs when highlighting (#87972).
1682
- // let tabs: usize = line
1683
- // .chars()
1684
- // .take(start)
1685
- // .map(|ch| match ch {
1686
- // '\t' => 3,
1687
- // _ => 0,
1688
- // })
1689
- // .sum();
1690
- let tabs = 0 ;
1682
+ let tabs: usize = line
1683
+ . chars ( )
1684
+ . take ( start)
1685
+ . map ( |ch| match ch {
1686
+ '\t' => 3 ,
1687
+ _ => 0 ,
1688
+ } )
1689
+ . sum ( ) ;
1691
1690
buffer. set_style_range (
1692
1691
row_num,
1693
1692
max_line_num_len + 3 + start + tabs,
Original file line number Diff line number Diff line change @@ -297,11 +297,11 @@ impl CodeSuggestion {
297
297
count -= 1 ;
298
298
}
299
299
} else {
300
+ acc = 0 ;
300
301
highlights. push ( std:: mem:: take ( & mut line_highlight) ) ;
301
302
let mut count = push_trailing ( & mut buf, prev_line. as_ref ( ) , & prev_hi, None ) ;
302
303
while count > 0 {
303
304
highlights. push ( std:: mem:: take ( & mut line_highlight) ) ;
304
- acc = 0 ;
305
305
count -= 1 ;
306
306
}
307
307
// push lines between the previous and current span (if any)
@@ -310,7 +310,6 @@ impl CodeSuggestion {
310
310
buf. push_str ( line. as_ref ( ) ) ;
311
311
buf. push ( '\n' ) ;
312
312
highlights. push ( std:: mem:: take ( & mut line_highlight) ) ;
313
- acc = 0 ;
314
313
}
315
314
}
316
315
if let Some ( cur_line) = sf. get_line ( cur_lo. line - 1 ) {
You can’t perform that action at this time.
0 commit comments