@@ -80,7 +80,7 @@ pub struct InteractivePrinter<'a> {
80 pub line_changes: Option<LineChanges>,
80 pub line_changes: Option<LineChanges>,
81 highlighter: Option<HighlightLines<'a>>,
81 highlighter: Option<HighlightLines<'a>>,
82 syntax_set: &'a SyntaxSet,
82 syntax_set: &'a SyntaxSet,
83− background_highlight: Option<Color>,
83+ background_color_highlight: Option<Color>,
86impl<'a> InteractivePrinter<'a> {
86impl<'a> InteractivePrinter<'a> {
@@ -92,7 +92,7 @@ impl<'a> InteractivePrinter<'a> {
92 ) -> Self {
92 ) -> Self {
93 let theme = assets.get_theme(&config.theme);
93 let theme = assets.get_theme(&config.theme);
95− let background_highlight = theme.settings.line_highlight;
95+ let background_color_highlight = theme.settings.line_highlight;
97 let colors = if config.colored_output {
97 let colors = if config.colored_output {
98 Colors::colored(theme, config.true_color)
98 Colors::colored(theme, config.true_color)
@@ -160,7 +160,7 @@ impl<'a> InteractivePrinter<'a> {
160 line_changes,
160 line_changes,
161 highlighter,
161 highlighter,
162 syntax_set: &assets.syntax_set,
162 syntax_set: &assets.syntax_set,
163− background_highlight,
163+ background_color_highlight,
@@ -292,6 +292,19 @@ impl<'a> Printer for InteractivePrinter<'a> {
292 let mut cursor_total: usize = 0;
292 let mut cursor_total: usize = 0;
293 let mut panel_wrap: Option<String> = None;
293 let mut panel_wrap: Option<String> = None;
295+ // Line highlighting
296+ let background_color = if self
300+ .find(|&&l| l == line_number)
303+ self.background_color_highlight
295 // Line decorations.
308 // Line decorations.
296 if self.panel_width > 0 {
309 if self.panel_width > 0 {
297 let decorations = self
310 let decorations = self
@@ -306,12 +319,6 @@ impl<'a> Printer for InteractivePrinter<'a> {
309− // Line highlighting
310− let background = self.config.highlight_line
311− .filter(|line| *line == line_number)
312− .map(|_| self.background_highlight)
315 // Line contents.
322 // Line contents.
316 if self.config.output_wrap == OutputWrap::None {
323 if self.config.output_wrap == OutputWrap::None {
317 let true_color = self.config.true_color;
324 let true_color = self.config.true_color;
@@ -324,7 +331,14 @@ impl<'a> Printer for InteractivePrinter<'a> {
327− as_terminal_escaped(style, text_trimmed, true_color, colored_output, italics, background)
334+ as_terminal_escaped(
329 write!(handle, "{}", &text[text_trimmed.len()..])?;
343 write!(handle, "{}", &text[text_trimmed.len()..])?;
@@ -382,7 +396,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
382 self.config.true_color,
396 self.config.true_color,
383 self.config.colored_output,
397 self.config.colored_output,
384 self.config.use_italic_text,
398 self.config.use_italic_text,
385− background
399+ background_color
@@ -423,7 +437,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
423 self.config.true_color,
437 self.config.true_color,
424 self.config.colored_output,
438 self.config.colored_output,
425 self.config.use_italic_text,
439 self.config.use_italic_text,
426− background
440+ background_color
428 panel_wrap.clone().unwrap()
442 panel_wrap.clone().unwrap()