@@ -293,17 +293,15 @@ impl<'a> Printer for InteractivePrinter<'a> {
293293 let mut panel_wrap: Option<String> = None;
294294
295295 // Line highlighting
296− let background_color = if self
296+ let highlight_this_line = self
297297 .config
298298 .highlight_lines
299299 .iter()
300− .find(|&&l| l == line_number)
301− .is_some()
302− {
303− self.background_color_highlight
304− } else {
305− None
306− };
300+ .any(|&l| l == line_number);
301+
302+ let background_color = self
303+ .background_color_highlight
304+ .filter(|_| highlight_this_line);
307305
308306 // Line decorations.
309307 if self.panel_width > 0 {
@@ -340,7 +338,20 @@ impl<'a> Printer for InteractivePrinter<'a> {
340338 background_color
341339 )
342340 )?;
343− write!(handle, "{}", &text[text_trimmed.len()..])?;
341+
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
348+ } else {
349+ 0
350+ };
351+ write!(handle, "{}", ansi_style.paint(" ".repeat(width)))?;
352+ }
353+ write!(handle, "{}", &text[text_trimmed.len()..])?;
354+ }
344355 }
345356
346357 if line.bytes().next_back() != Some(b'\n') {
@@ -450,6 +461,17 @@ impl<'a> Printer for InteractivePrinter<'a> {
450461 }
451462 }
452463
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));
468+
469+ write!(
470+ handle,
471+ "{}",
472+ ansi_style.paint(" ".repeat(cursor_max - cursor))
473+ )?;
474+ }
453475 write!(handle, "\n")?;
454476 }
455477