@@ -90,6 +90,7 @@ pub enum Style {
9090 UnderlineSecondary ,
9191 LabelPrimary ,
9292 LabelSecondary ,
93+ OldSkoolNote ,
9394 NoStyle ,
9495}
9596
@@ -497,6 +498,28 @@ impl FileInfo {
497498 match self . primary_span {
498499 Some ( span) => {
499500 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+ }
500523 rendered_lines[ 0 ] . text . insert ( 0 , StyledString {
501524 text : format ! ( ":{} " , lo. line) ,
502525 style : Style :: LineAndColumn ,
0 commit comments