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