on master help sign in
Remove padding if the header style is not enabled
b337339Prat T
src/printer.rs−2
@@ -247,8 +247,6 @@ impl<'a> Printer for InteractivePrinter<'a> {
247 )?;
247 )?;
248 } else if self.config.style_components.grid() {
248 } else if self.config.style_components.grid() {
249 self.print_horizontal_line(handle, '┬')?;
249 self.print_horizontal_line(handle, '┬')?;
250− } else if add_header_padding {
251− writeln!(handle)?;
252 }
250 }
253 return Ok(());
251 return Ok(());
254 }
252 }
tests/integration_tests.rs+2−2
@@ -632,11 +632,11 @@ fn filename_multiple_err() {
632fn header_padding() {
632fn header_padding() {
633 bat()
633 bat()
634 .arg("--decorations=always")
634 .arg("--decorations=always")
635− .arg("--style=plain")
635+ .arg("--style=header")
636 .arg("test.txt")
636 .arg("test.txt")
637 .arg("single-line.txt")
637 .arg("single-line.txt")
638 .assert()
638 .assert()
639− .stdout("hello world\n\nSingle Line\n")
639+ .stdout("File: test.txt\nhello world\n\nFile: single-line.txt\nSingle Line\n")
640 .stderr("");
640 .stderr("");
641}
641}
642
642