@@ -1105,10 +1105,10 @@ impl EmitterWriter {
11051105 buffer. append ( 0 , & level. to_string ( ) , Style :: Level ( level. clone ( ) ) ) ;
11061106 buffer. append ( 0 , ": " , Style :: HeaderMsg ) ;
11071107 self . msg_to_buffer ( & mut buffer,
1108- & [ ( suggestion. msg . to_owned ( ) , Style :: NoStyle ) ] ,
1109- max_line_num_len,
1110- "suggestion" ,
1111- Some ( Style :: HeaderMsg ) ) ;
1108+ & [ ( suggestion. msg . to_owned ( ) , Style :: NoStyle ) ] ,
1109+ max_line_num_len,
1110+ "suggestion" ,
1111+ Some ( Style :: HeaderMsg ) ) ;
11121112
11131113 // Render the replacements for each suggestion
11141114 let suggestions = suggestion. splice_lines ( cm. borrow ( ) ) ;
@@ -1145,8 +1145,9 @@ impl EmitterWriter {
11451145 // entirety of the code being shown and the displayed code is not multiline.
11461146 if show_underline {
11471147 draw_col_separator ( & mut buffer, row_num, max_line_num_len + 1 ) ;
1148- let sub_len = parts[ 0 ] . snippet . len ( ) ;
1149- let underline_start = span_start_pos. col . 0 ;
1148+ let start = parts[ 0 ] . snippet . len ( ) - parts[ 0 ] . snippet . trim_left ( ) . len ( ) ;
1149+ let sub_len = parts[ 0 ] . snippet . trim ( ) . len ( ) ;
1150+ let underline_start = span_start_pos. col . 0 + start;
11501151 let underline_end = span_start_pos. col . 0 + sub_len;
11511152 for p in underline_start..underline_end {
11521153 buffer. putc ( row_num,
0 commit comments