@@ -103,7 +103,6 @@ impl<'a> ItemRenderer<'a> {
103103 let list_item = self . render_sub_line (
104104 item,
105105 sub_text,
106- & sub_lines,
107106 & SubLineState {
108107 is_current,
109108 is_selected,
@@ -158,13 +157,12 @@ impl<'a> ItemRenderer<'a> {
158157 & self ,
159158 item : & MatchedItem ,
160159 sub_text : & str ,
161- sub_lines : & [ & str ] ,
162160 state : & SubLineState ,
163161 match_start_char : usize ,
164162 match_end_char : usize ,
165163 ) -> ListItem < ' static > {
166164 let mut all_spans = self . prefix_spans ( item, state) ;
167- let content_line = self . content_line ( item, sub_text, sub_lines , state, match_start_char, match_end_char) ;
165+ let content_line = self . content_line ( item, sub_text, state, match_start_char, match_end_char) ;
168166
169167 if state. needs_ellipsis {
170168 all_spans. extend ( self . trim_with_ellipsis ( content_line, state. is_current ) ) ;
@@ -238,13 +236,12 @@ impl<'a> ItemRenderer<'a> {
238236 & self ,
239237 item : & MatchedItem ,
240238 sub_text : & str ,
241- sub_lines : & [ & str ] ,
242239 state : & SubLineState ,
243240 match_start_char : usize ,
244241 match_end_char : usize ,
245242 ) -> Line < ' static > {
246- if state. is_first_sub_line {
247- self . first_sub_line_content ( item, sub_lines [ 0 ] , state. is_current , match_start_char, match_end_char)
243+ if state. is_first && state . is_first_sub_line {
244+ self . first_sub_line_content ( item, sub_text , state. is_current , match_start_char, match_end_char)
248245 } else {
249246 self . continuation_sub_line_content ( sub_text, state. is_current )
250247 }
@@ -295,8 +292,7 @@ impl<'a> ItemRenderer<'a> {
295292 if self . wrap {
296293 raw
297294 } else {
298- let text = raw. spans . first ( ) . map_or ( "" , |span| span. content . as_ref ( ) ) ;
299- let ( shift, full_width, _, _) = self . calc_hscroll ( text, 0 , 0 ) ;
295+ let ( shift, full_width, _, _) = self . calc_hscroll ( sub_text, 0 , 0 ) ;
300296 let scrolled = self . apply_hscroll ( raw, shift, full_width) ;
301297 Self :: into_static_line ( scrolled)
302298 }
0 commit comments