@@ -7,6 +7,7 @@ use ansi_term::Style;
77use console::AnsiCodeIterator;
88
99use syntect::easy::HighlightLines;
10+use syntect::highlighting::Color;
1011use syntect::highlighting::Theme;
1112use syntect::parsing::SyntaxSet;
1213
@@ -79,6 +80,7 @@ pub struct InteractivePrinter<'a> {
7980 pub line_changes: Option<LineChanges>,
8081 highlighter: Option<HighlightLines<'a>>,
8182 syntax_set: &'a SyntaxSet,
83+ background_highlight: Option<Color>,
8284}
8385
8486impl<'a> InteractivePrinter<'a> {
@@ -90,6 +92,8 @@ impl<'a> InteractivePrinter<'a> {
9092 ) -> Self {
9193 let theme = assets.get_theme(&config.theme);
9294
95+ let background_highlight = theme.settings.line_highlight;
96+
9397 let colors = if config.colored_output {
9498 Colors::colored(theme, config.true_color)
9599 } else {
@@ -156,6 +160,7 @@ impl<'a> InteractivePrinter<'a> {
156160 line_changes,
157161 highlighter,
158162 syntax_set: &assets.syntax_set,
163+ background_highlight,
159164 }
160165 }
161166
@@ -301,6 +306,12 @@ impl<'a> Printer for InteractivePrinter<'a> {
301306 }
302307 }
303308
309+ // Line highlighting
310+ let background = self.config.highlight_line
311+ .filter(|line| *line == line_number)
312+ .map(|_| self.background_highlight)
313+ .unwrap();
314+
304315 // Line contents.
305316 if self.config.output_wrap == OutputWrap::None {
306317 let true_color = self.config.true_color;
@@ -313,7 +324,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
313324 write!(
314325 handle,
315326 "{}",
316− as_terminal_escaped(style, text_trimmed, true_color, colored_output, italics,)
327+ as_terminal_escaped(style, text_trimmed, true_color, colored_output, italics, background)
317328 )?;
318329 write!(handle, "{}", &text[text_trimmed.len()..])?;
319330 }
@@ -370,7 +381,8 @@ impl<'a> Printer for InteractivePrinter<'a> {
370381 ),
371382 self.config.true_color,
372383 self.config.colored_output,
373− self.config.use_italic_text
384+ self.config.use_italic_text,
385+ background
374386 )
375387 )?;
376388 break;
@@ -410,7 +422,8 @@ impl<'a> Printer for InteractivePrinter<'a> {
410422 ),
411423 self.config.true_color,
412424 self.config.colored_output,
413− self.config.use_italic_text
425+ self.config.use_italic_text,
426+ background
414427 ),
415428 panel_wrap.clone().unwrap()
416429 )?;