@@ -1670,23 +1670,27 @@ impl HumanEmitter {
1670
1670
{
1671
1671
already_closed = Some ( !labels. is_empty ( ) ) ;
1672
1672
}
1673
- for ( label, is_primary) in labels. into_iter ( ) {
1673
+ let labels_len = labels. len ( ) ;
1674
+ for ( label_idx, ( label, is_primary) ) in labels. into_iter ( ) . enumerate ( ) {
1674
1675
let style = if is_primary {
1675
1676
Style :: LabelPrimary
1676
1677
} else {
1677
1678
Style :: LabelSecondary
1678
1679
} ;
1679
- let pipe = self . col_separator ( ) ;
1680
- buffer . prepend ( line_idx , & format ! ( " {pipe}" ) , Style :: LineNumber ) ;
1681
- for _ in 0 ..max_line_num_len {
1682
- buffer . prepend ( line_idx , " " , Style :: NoStyle ) ;
1683
- }
1680
+ self . draw_col_separator_no_space (
1681
+ & mut buffer ,
1682
+ line_idx ,
1683
+ max_line_num_len + 1 ,
1684
+ ) ;
1684
1685
line_idx += 1 ;
1685
- let chr = self . note_separator ( ) ;
1686
- buffer. append ( line_idx, & format ! ( " {chr} note: " ) , style) ;
1687
- for _ in 0 ..max_line_num_len {
1688
- buffer. prepend ( line_idx, " " , Style :: NoStyle ) ;
1689
- }
1686
+ self . draw_note_separator (
1687
+ & mut buffer,
1688
+ line_idx,
1689
+ max_line_num_len + 1 ,
1690
+ label_idx != labels_len - 1 ,
1691
+ ) ;
1692
+ buffer. append ( line_idx, "note" , Style :: MainHeaderMsg ) ;
1693
+ buffer. append ( line_idx, ": " , Style :: NoStyle ) ;
1690
1694
buffer. append ( line_idx, label, style) ;
1691
1695
line_idx += 1 ;
1692
1696
}
@@ -2862,10 +2866,11 @@ impl HumanEmitter {
2862
2866
}
2863
2867
}
2864
2868
2865
- fn note_separator ( & self ) -> char {
2869
+ fn note_separator ( & self , is_cont : bool ) -> & ' static str {
2866
2870
match self . theme {
2867
- OutputTheme :: Ascii => '=' ,
2868
- OutputTheme :: Unicode => '╰' ,
2871
+ OutputTheme :: Ascii => "= " ,
2872
+ OutputTheme :: Unicode if is_cont => "├ " ,
2873
+ OutputTheme :: Unicode => "╰ " ,
2869
2874
}
2870
2875
}
2871
2876
@@ -2978,11 +2983,7 @@ impl HumanEmitter {
2978
2983
col : usize ,
2979
2984
is_cont : bool ,
2980
2985
) {
2981
- let chr = match self . theme {
2982
- OutputTheme :: Ascii => "= " ,
2983
- OutputTheme :: Unicode if is_cont => "├ " ,
2984
- OutputTheme :: Unicode => "╰ " ,
2985
- } ;
2986
+ let chr = self . note_separator ( is_cont) ;
2986
2987
buffer. puts ( line, col, chr, Style :: LineNumber ) ;
2987
2988
}
2988
2989
0 commit comments