@@ -90,6 +90,7 @@ pub enum Style {
90
90
UnderlineSecondary ,
91
91
LabelPrimary ,
92
92
LabelSecondary ,
93
+ OldSkoolNote ,
93
94
NoStyle ,
94
95
}
95
96
@@ -497,6 +498,28 @@ impl FileInfo {
497
498
match self . primary_span {
498
499
Some ( span) => {
499
500
let lo = codemap. lookup_char_pos ( span. lo ) ;
501
+ //Before each secondary line in old skool-mode, print the label
502
+ //as an old-style note
503
+ if !line. annotations [ 0 ] . is_primary {
504
+ if let Some ( ann) = line. annotations [ 0 ] . label . clone ( ) {
505
+ output. push ( RenderedLine {
506
+ text : vec ! [ StyledString {
507
+ text: lo. file. name. clone( ) ,
508
+ style: Style :: FileNameStyle ,
509
+ } , StyledString {
510
+ text: format!( ":{}:{}: " , lo. line, lo. col. 0 + 1 ) ,
511
+ style: Style :: LineAndColumn ,
512
+ } , StyledString {
513
+ text: format!( "note: " ) ,
514
+ style: Style :: LabelSecondary ,
515
+ } , StyledString {
516
+ text: format!( "{}" , ann) ,
517
+ style: Style :: OldSkoolNote ,
518
+ } ] ,
519
+ kind : RenderedLineKind :: Annotations ,
520
+ } ) ;
521
+ }
522
+ }
500
523
rendered_lines[ 0 ] . text . insert ( 0 , StyledString {
501
524
text : format ! ( ":{} " , lo. line) ,
502
525
style : Style :: LineAndColumn ,
0 commit comments