@@ -3,7 +3,7 @@ extern crate ansi_term;
33use self :: ansi_term:: Color :: Fixed ;
44use self :: ansi_term:: Style ;
55use display_list:: { DisplayAnnotationType , DisplayLine , DisplayList , DisplayMark ,
6- DisplaySnippetType } ;
6+ DisplaySnippetType , DisplayHeaderType } ;
77use display_list_formatting:: DisplayListFormatting ;
88use std:: fmt;
99
@@ -109,15 +109,29 @@ impl DisplayListFormatting for Formatter {
109109Style :: new( ) . bold( ) . paint( format!( ": {}" , label) )
110110)
111111}
112- DisplayLine :: Origin { path, row, col} =>writeln ! (
113- f,
114- "{}{} {}:{}:{}" ,
115- " " . repeat( lineno_width) ,
116- Fixed ( 12 ) . bold( ) . paint( "-->" ) ,
112+ DisplayLine :: Origin {
117113 path,
118- row,
119- col
120- ) ,
114+ pos,
115+ header_type,
116+ } =>{
117+ let header_sigil =match header_type{
118+ DisplayHeaderType :: Initial =>"-->" ,
119+ DisplayHeaderType :: Continuation =>":::" ,
120+ } ;
121+ if let Some ( ( row, col) ) = pos{
122+ writeln ! (
123+ f,
124+ "{}{} {}:{}:{}" ,
125+ " " . repeat( lineno_width) ,
126+ Fixed ( 12 ) . bold( ) . paint( header_sigil) ,
127+ path,
128+ row,
129+ col
130+ )
131+ } else {
132+ writeln ! ( f, "{}{} {}" , " " . repeat( lineno_width) , Fixed ( 12 ) . bold( ) . paint( header_sigil) , path, )
133+ }
134+ }
121135DisplayLine :: EmptySource =>{
122136let prefix =format ! ( "{} |" , " " . repeat( lineno_width) ) ;
123137writeln ! ( f, "{}" , Fixed ( 12 ) . bold( ) . paint( prefix) )