File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ impl DisplayListFormatter {
303
303
inline_marks,
304
304
line,
305
305
} => {
306
- let lineno = if self . anonymized_line_numbers {
306
+ let lineno = if self . anonymized_line_numbers && lineno . is_some ( ) {
307
307
Self :: ANONYMIZED_LINE_NUM . to_string ( )
308
308
} else {
309
309
self . format_lineno ( * lineno, lineno_width)
Original file line number Diff line number Diff line change @@ -515,13 +515,26 @@ fn test_anon_lines() {
515
515
range: ( 0 , 19 ) ,
516
516
} ,
517
517
} ,
518
+ DisplayLine :: Source {
519
+ lineno: None ,
520
+ inline_marks: vec![ ] ,
521
+ line: DisplaySourceLine :: Empty ,
522
+ } ,
523
+ DisplayLine :: Source {
524
+ lineno: None ,
525
+ inline_marks: vec![ ] ,
526
+ line: DisplaySourceLine :: Content {
527
+ text: "abc" . to_string( ) ,
528
+ range: ( 0 , 19 ) ,
529
+ } ,
530
+ } ,
518
531
] ) ;
519
532
520
533
let dlf = DisplayListFormatter :: new ( false , true ) ;
521
534
522
535
assert_eq ! (
523
536
dlf. format( & dl) ,
524
- "LL | This is an example\n LL | of content lines"
537
+ "LL | This is an example\n LL | of content lines\n | \n | abc "
525
538
) ;
526
539
}
527
540
You can’t perform that action at this time.
0 commit comments