@@ -3,7 +3,7 @@ extern crate ansi_term;
3
3
use self :: ansi_term:: Color :: Fixed ;
4
4
use self :: ansi_term:: Style ;
5
5
use display_list:: { DisplayAnnotationType , DisplayLine , DisplayList , DisplayMark ,
6
- DisplaySnippetType } ;
6
+ DisplaySnippetType , DisplayHeaderType } ;
7
7
use display_list_formatting:: DisplayListFormatting ;
8
8
use std:: fmt;
9
9
@@ -109,15 +109,29 @@ impl DisplayListFormatting for Formatter {
109
109
Style :: new( ) . bold( ) . paint( format!( ": {}" , label) )
110
110
)
111
111
}
112
- DisplayLine :: Origin { path, row, col } => writeln ! (
113
- f,
114
- "{}{} {}:{}:{}" ,
115
- " " . repeat( lineno_width) ,
116
- Fixed ( 12 ) . bold( ) . paint( "-->" ) ,
112
+ DisplayLine :: Origin {
117
113
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
+ }
121
135
DisplayLine :: EmptySource => {
122
136
let prefix = format ! ( "{} |" , " " . repeat( lineno_width) ) ;
123
137
writeln ! ( f, "{}" , Fixed ( 12 ) . bold( ) . paint( prefix) )
0 commit comments