@@ -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
@@ -296,6 +301,18 @@ impl<'a> Printer for InteractivePrinter<'a> {
296301 }
297302 }
298303
304+ // Line highlighting
305+ let background = match self.config.highlight_line {
306+ Some(line) => {
307+ if line_number == line {
308+ self.background_highlight
309+ } else {
310+ None
311+ }
312+ }
313+ _ => None
314+ };
315+
299316 // Line contents.
300317 if self.config.output_wrap == OutputWrap::None {
301318 let true_color = self.config.true_color;
@@ -306,7 +323,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
306323 write!(
307324 handle,
308325 "{}",
309− as_terminal_escaped(style, &*text, true_color, colored_output,)
326+ as_terminal_escaped(style, &*text, true_color, colored_output, background)
310327 )?;
311328 }
312329
@@ -362,6 +379,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
362379 ),
363380 self.config.true_color,
364381 self.config.colored_output,
382+ background
365383 )
366384 )?;
367385 break;
@@ -401,6 +419,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
401419 ),
402420 self.config.true_color,
403421 self.config.colored_output,
422+ background
404423 ),
405424 panel_wrap.clone().unwrap()
406425 )?;