@@ -346,12 +346,6 @@ impl Renderer {
346346 max_line_num_len + 1 ,
347347 ) ;
348348 }
349- Some ( Element :: Origin ( origin) ) if origin. primary => self
350- . draw_col_separator_end (
351- & mut buffer,
352- current_line,
353- max_line_num_len + 1 ,
354- ) ,
355349 None if group_len > 1 => self . draw_col_separator_end (
356350 & mut buffer,
357351 current_line,
@@ -386,6 +380,7 @@ impl Renderer {
386380 & mut buffer,
387381 max_line_num_len,
388382 origin,
383+ is_primary,
389384 buffer_msg_line_offset,
390385 ) ;
391386 last_was_suggestion = false ;
@@ -472,7 +467,6 @@ impl Renderer {
472467
473468 if let Some ( path) = & cause. path {
474469 let mut origin = Origin :: path ( path. as_ref ( ) ) ;
475- origin. primary = true ;
476470
477471 let source_map = SourceMap :: new ( & cause. source , cause. line_start ) ;
478472 let ( _depth, annotated_lines) =
@@ -493,7 +487,7 @@ impl Renderer {
493487 }
494488 }
495489
496- self . render_origin ( & mut buffer, 0 , & origin, 0 ) ;
490+ self . render_origin ( & mut buffer, 0 , & origin, true , 0 ) ;
497491 buffer. append ( 0 , ": " , ElementStyle :: LineAndColumn ) ;
498492 }
499493 }
@@ -641,9 +635,10 @@ impl Renderer {
641635 buffer : & mut StyledBuffer ,
642636 max_line_num_len : usize ,
643637 origin : & Origin < ' _ > ,
638+ is_primary : bool ,
644639 buffer_msg_line_offset : usize ,
645640 ) {
646- if origin . primary && !self . short_message {
641+ if is_primary && !self . short_message {
647642 buffer. prepend (
648643 buffer_msg_line_offset,
649644 self . file_start ( ) ,
@@ -712,7 +707,6 @@ impl Renderer {
712707 //let is_primary = primary_path == Some(&origin.path);
713708
714709 if is_primary {
715- origin. primary = true ;
716710 if let Some ( primary_line) = annotated_lines
717711 . iter ( )
718712 . find ( |l| l. annotations . iter ( ) . any ( LineAnnotation :: is_primary) )
@@ -752,7 +746,13 @@ impl Renderer {
752746 }
753747 }
754748 let buffer_msg_line_offset = buffer. num_lines ( ) ;
755- self . render_origin ( buffer, max_line_num_len, & origin, buffer_msg_line_offset) ;
749+ self . render_origin (
750+ buffer,
751+ max_line_num_len,
752+ & origin,
753+ is_primary,
754+ buffer_msg_line_offset,
755+ ) ;
756756 // Put in the spacer between the location and annotated source
757757 self . draw_col_separator_no_space (
758758 buffer,
0 commit comments