@@ -7,6 +7,7 @@ use ansi_term::Style;
7use console::AnsiCodeIterator;
7use console::AnsiCodeIterator;
9use syntect::easy::HighlightLines;
9use syntect::easy::HighlightLines;
10+use syntect::highlighting::Color;
10use syntect::highlighting::Theme;
11use syntect::highlighting::Theme;
11use syntect::parsing::SyntaxSet;
12use syntect::parsing::SyntaxSet;
@@ -79,6 +80,7 @@ pub struct InteractivePrinter<'a> {
79 pub line_changes: Option<LineChanges>,
80 pub line_changes: Option<LineChanges>,
80 highlighter: Option<HighlightLines<'a>>,
81 highlighter: Option<HighlightLines<'a>>,
81 syntax_set: &'a SyntaxSet,
82 syntax_set: &'a SyntaxSet,
83+ background_highlight: Option<Color>,
84impl<'a> InteractivePrinter<'a> {
86impl<'a> InteractivePrinter<'a> {
@@ -90,6 +92,8 @@ impl<'a> InteractivePrinter<'a> {
90 ) -> Self {
92 ) -> Self {
91 let theme = assets.get_theme(&config.theme);
93 let theme = assets.get_theme(&config.theme);
95+ let background_highlight = theme.settings.line_highlight;
93 let colors = if config.colored_output {
97 let colors = if config.colored_output {
94 Colors::colored(theme, config.true_color)
98 Colors::colored(theme, config.true_color)
@@ -156,6 +160,7 @@ impl<'a> InteractivePrinter<'a> {
156 line_changes,
160 line_changes,
157 highlighter,
161 highlighter,
158 syntax_set: &assets.syntax_set,
162 syntax_set: &assets.syntax_set,
163+ background_highlight,
@@ -296,6 +301,18 @@ impl<'a> Printer for InteractivePrinter<'a> {
304+ // Line highlighting
305+ let background = match self.config.highlight_line {
307+ if line_number == line {
308+ self.background_highlight
299 // Line contents.
316 // Line contents.
300 if self.config.output_wrap == OutputWrap::None {
317 if self.config.output_wrap == OutputWrap::None {
301 let true_color = self.config.true_color;
318 let true_color = self.config.true_color;
@@ -306,7 +323,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
309− as_terminal_escaped(style, &*text, true_color, colored_output,)
326+ as_terminal_escaped(style, &*text, true_color, colored_output, background)
@@ -362,6 +379,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
363 self.config.true_color,
380 self.config.true_color,
364 self.config.colored_output,
381 self.config.colored_output,
@@ -401,6 +419,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
402 self.config.true_color,
420 self.config.true_color,
403 self.config.colored_output,
421 self.config.colored_output,
405 panel_wrap.clone().unwrap()
424 panel_wrap.clone().unwrap()