@@ -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,
@@ -301,6 +306,12 @@ 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)
304 // Line contents.
315 // Line contents.
305 if self.config.output_wrap == OutputWrap::None {
316 if self.config.output_wrap == OutputWrap::None {
306 let true_color = self.config.true_color;
317 let true_color = self.config.true_color;
@@ -313,7 +324,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
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)
318 write!(handle, "{}", &text[text_trimmed.len()..])?;
329 write!(handle, "{}", &text[text_trimmed.len()..])?;
@@ -370,7 +381,8 @@ impl<'a> Printer for InteractivePrinter<'a> {
371 self.config.true_color,
382 self.config.true_color,
372 self.config.colored_output,
383 self.config.colored_output,
373− self.config.use_italic_text
384+ self.config.use_italic_text,
@@ -410,7 +422,8 @@ impl<'a> Printer for InteractivePrinter<'a> {
411 self.config.true_color,
423 self.config.true_color,
412 self.config.colored_output,
424 self.config.colored_output,
413− self.config.use_italic_text
425+ self.config.use_italic_text,
415 panel_wrap.clone().unwrap()
428 panel_wrap.clone().unwrap()