File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ impl DisplayListFormatter {
303303 inline_marks,
304304 line,
305305 } => {
306- let lineno = if self . anonymized_line_numbers {
306+ let lineno = if self . anonymized_line_numbers && lineno . is_some ( ) {
307307 Self :: ANONYMIZED_LINE_NUM . to_string ( )
308308 } else {
309309 self . format_lineno ( * lineno, lineno_width)
Original file line number Diff line number Diff line change @@ -515,13 +515,26 @@ fn test_anon_lines() {
515515 range: ( 0 , 19 ) ,
516516 } ,
517517 } ,
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+ } ,
518531 ] ) ;
519532
520533 let dlf = DisplayListFormatter :: new ( false , true ) ;
521534
522535 assert_eq ! (
523536 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 "
525538 ) ;
526539}
527540
You can’t perform that action at this time.
0 commit comments