@@ -33,7 +33,12 @@ use crate::terminal::{as_terminal_escaped, to_ansi_color};
33use crate::wrapping::WrappingMode;
33use crate::wrapping::WrappingMode;
35pub(crate) trait Printer {
35pub(crate) trait Printer {
36− fn print_header(&mut self, handle: &mut dyn Write, input: &OpenedInput) -> Result<()>;
38+ handle: &mut dyn Write,
40+ add_header_padding: bool,
37 fn print_footer(&mut self, handle: &mut dyn Write, input: &OpenedInput) -> Result<()>;
42 fn print_footer(&mut self, handle: &mut dyn Write, input: &OpenedInput) -> Result<()>;
39 fn print_snip(&mut self, handle: &mut dyn Write) -> Result<()>;
44 fn print_snip(&mut self, handle: &mut dyn Write) -> Result<()>;
@@ -56,7 +61,12 @@ impl SimplePrinter {
58impl Printer for SimplePrinter {
63impl Printer for SimplePrinter {
59− fn print_header(&mut self, _handle: &mut dyn Write, _input: &OpenedInput) -> Result<()> {
66+ _handle: &mut dyn Write,
67+ _input: &OpenedInput,
68+ _add_header_padding: bool,
@@ -219,7 +229,12 @@ impl<'a> InteractivePrinter<'a> {
221impl<'a> Printer for InteractivePrinter<'a> {
231impl<'a> Printer for InteractivePrinter<'a> {
222− fn print_header(&mut self, handle: &mut dyn Write, input: &OpenedInput) -> Result<()> {
234+ handle: &mut dyn Write,
235+ input: &OpenedInput,
236+ add_header_padding: bool,
223 if !self.config.style_components.header() {
238 if !self.config.style_components.header() {
224 if Some(ContentType::BINARY) == self.content_type && !self.config.show_nonprintable {
239 if Some(ContentType::BINARY) == self.content_type && !self.config.show_nonprintable {
225 writeln!(
240 writeln!(
@@ -232,6 +247,8 @@ impl<'a> Printer for InteractivePrinter<'a> {
233 } else if self.config.style_components.grid() {
248 } else if self.config.style_components.grid() {
234 self.print_horizontal_line(handle, '┬')?;
249 self.print_horizontal_line(handle, '┬')?;
250+ } else if add_header_padding {
236 return Ok(());
253 return Ok(());
@@ -248,6 +265,9 @@ impl<'a> Printer for InteractivePrinter<'a> {
248 .paint(if self.panel_width > 0 { "│ " } else { "" }),
265 .paint(if self.panel_width > 0 { "│ " } else { "" }),
268+ if add_header_padding {
251 write!(handle, "{}", " ".repeat(self.panel_width))?;
271 write!(handle, "{}", " ".repeat(self.panel_width))?;