File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -518,10 +518,11 @@ fn highlight_lines(err: &mut EmitterWriter,
518
518
let count = match lastc {
519
519
// Most terminals have a tab stop every eight columns by default
520
520
'\t' => 8 - col%8 ,
521
- _ => lastc. width ( false ) . unwrap_or ( 1 ) ,
521
+ _ => lastc. width ( false ) . unwrap_or ( 0 ) ,
522
522
} ;
523
523
col += count;
524
- s. extend ( :: std:: iter:: repeat ( '~' ) . take ( count - 1 ) ) ;
524
+ s. extend ( :: std:: iter:: repeat ( '~' ) . take ( count) ) ;
525
+
525
526
let hi = cm. lookup_char_pos ( sp. hi ) ;
526
527
if hi. col != lo. col {
527
528
for ( pos, ch) in iter {
@@ -534,6 +535,12 @@ fn highlight_lines(err: &mut EmitterWriter,
534
535
s. extend ( :: std:: iter:: repeat ( '~' ) . take ( count) ) ;
535
536
}
536
537
}
538
+
539
+ if s. len ( ) > 1 {
540
+ // One extra squiggly is replaced by a "^"
541
+ s. pop ( ) ;
542
+ }
543
+
537
544
try!( print_maybe_styled ( err,
538
545
& format ! ( "{}\n " , s) [ ] ,
539
546
term:: attr:: ForegroundColor ( lvl. color ( ) ) ) ) ;
You can’t perform that action at this time.
0 commit comments