@@ -130,8 +130,8 @@ impl Margin {
130130 fn was_cut_right ( & self , line_len : usize ) -> bool {
131131 let right =
132132 if self . computed_right == self . span_right || self . computed_right == self . label_right {
133- // Account for the "..." padding given above. Otherwise we end up with code lines that
134- // do fit but end in "..." as if they were trimmed.
133+ // Account for the "..." padding given above. Otherwise we end up with code lines
134+ // that do fit but end in "..." as if they were trimmed.
135135 self . computed_right - 6
136136 } else {
137137 self . computed_right
@@ -657,9 +657,9 @@ pub struct HumanEmitter {
657657}
658658
659659#[ derive( Debug ) ]
660- pub struct FileWithAnnotatedLines {
661- pub file : Lrc < SourceFile > ,
662- pub lines : Vec < Line > ,
660+ pub ( crate ) struct FileWithAnnotatedLines {
661+ pub ( crate ) file : Lrc < SourceFile > ,
662+ pub ( crate ) lines : Vec < Line > ,
663663 multiline_depth : usize ,
664664}
665665
@@ -724,8 +724,9 @@ impl HumanEmitter {
724724 . skip ( left)
725725 . take_while ( |ch| {
726726 // Make sure that the trimming on the right will fall within the terminal width.
727- // FIXME: `unicode_width` sometimes disagrees with terminals on how wide a `char` is.
728- // For now, just accept that sometimes the code line will be longer than desired.
727+ // FIXME: `unicode_width` sometimes disagrees with terminals on how wide a `char`
728+ // is. For now, just accept that sometimes the code line will be longer than
729+ // desired.
729730 let next = unicode_width:: UnicodeWidthChar :: width ( * ch) . unwrap_or ( 1 ) ;
730731 if taken + next > right - left {
731732 return false ;
@@ -2228,8 +2229,8 @@ impl HumanEmitter {
22282229 buffer. puts ( * row_num - 1 , max_line_num_len + 3 , & line, Style :: NoStyle ) ;
22292230 * row_num += 1 ;
22302231 }
2231- // If the last line is exactly equal to the line we need to add, we can skip both of them.
2232- // This allows us to avoid output like the following:
2232+ // If the last line is exactly equal to the line we need to add, we can skip both of
2233+ // them. This allows us to avoid output like the following:
22332234 // 2 - &
22342235 // 2 + if true { true } else { false }
22352236 // 3 - if true { true } else { false }
@@ -2586,6 +2587,7 @@ fn num_overlap(
25862587 let extra = if inclusive { 1 } else { 0 } ;
25872588 ( b_start..b_end + extra) . contains ( & a_start) || ( a_start..a_end + extra) . contains ( & b_start)
25882589}
2590+
25892591fn overlaps ( a1 : & Annotation , a2 : & Annotation , padding : usize ) -> bool {
25902592 num_overlap (
25912593 a1. start_col . display ,
0 commit comments