@@ -293,17 +293,15 @@ impl<'a> Printer for InteractivePrinter<'a> {
293 let mut panel_wrap: Option<String> = None;
293 let mut panel_wrap: Option<String> = None;
295 // Line highlighting
295 // Line highlighting
296− let background_color = if self
296+ let highlight_this_line = self
298 .highlight_lines
298 .highlight_lines
300− .find(|&&l| l == line_number)
300+ .any(|&l| l == line_number);
302− {
302+ let background_color = self
303− self.background_color_highlight
303+ .background_color_highlight
304− } else {
304+ .filter(|_| highlight_this_line);
308 // Line decorations.
306 // Line decorations.
309 if self.panel_width > 0 {
307 if self.panel_width > 0 {
@@ -340,7 +338,20 @@ impl<'a> Printer for InteractivePrinter<'a> {
340 background_color
338 background_color
342+ if text.len() != text_trimmed.len() {
343+ if let Some(background_color) = background_color {
344+ let mut ansi_style = Style::default();
345+ ansi_style.background = Some(to_ansi_color(background_color, true_color));
346+ let width = if cursor_total <= cursor_max {
347+ cursor_max - cursor_total + 1
351+ write!(handle, "{}", ansi_style.paint(" ".repeat(width)))?;
343− write!(handle, "{}", &text[text_trimmed.len()..])?;
353+ write!(handle, "{}", &text[text_trimmed.len()..])?;
346 if line.bytes().next_back() != Some(b'\n') {
357 if line.bytes().next_back() != Some(b'\n') {
@@ -450,6 +461,17 @@ impl<'a> Printer for InteractivePrinter<'a> {
464+ if let Some(background_color) = background_color {
465+ let mut ansi_style = Style::default();
466+ ansi_style.background =
467+ Some(to_ansi_color(background_color, self.config.true_color));
472+ ansi_style.paint(" ".repeat(cursor_max - cursor))
453 write!(handle, "\n")?;
475 write!(handle, "\n")?;