diff --git a/src/paint.rs b/src/paint.rs index ecf76e2f3..32a5978dd 100644 --- a/src/paint.rs +++ b/src/paint.rs @@ -691,14 +691,15 @@ impl<'p> Painter<'p> { } else { None }; - Self::update_styles(&mut diff_sections.0, None, minus_non_emph_style); + let mut lines_style_sections = MinusPlus::new(&mut diff_sections.0, &mut diff_sections.1); + Self::update_styles(lines_style_sections[Minus], None, minus_non_emph_style); let plus_non_emph_style = if config.plus_non_emph_style != config.plus_emph_style { Some(config.plus_non_emph_style) } else { None }; Self::update_styles( - &mut diff_sections.1, + lines_style_sections[Plus], Some(config.whitespace_error_style), plus_non_emph_style, ); @@ -714,29 +715,27 @@ impl<'p> Painter<'p> { /// 2. If the line constitutes a whitespace error, then the whitespace error style /// should be applied to the added material. fn update_styles( - style_sections: &mut Vec>, + lines_style_sections: &mut Vec>, whitespace_error_style: Option