Remove padding if the header style is not enabled
commitb3373398e81d25ece5c654e4e755a38eb0de135e
authorPrat T <pt2121@users.noreply.github.com>
dateTue 12 May 2020, 07:06 (6 years ago)
parent0040fef
src/printer.rs−2
@@ -247,8 +247,6 @@ impl<'a> Printer for InteractivePrinter<'a> {
247247 )?;
248248 } else if self.config.style_components.grid() {
249249 self.print_horizontal_line(handle, '┬')?;
250− } else if add_header_padding {
251− writeln!(handle)?;
252250 }
253251 return Ok(());
254252 }
tests/integration_tests.rs+2−2
@@ -632,11 +632,11 @@ fn filename_multiple_err() {
632632fn header_padding() {
633633 bat()
634634 .arg("--decorations=always")
635− .arg("--style=plain")
635+ .arg("--style=header")
636636 .arg("test.txt")
637637 .arg("single-line.txt")
638638 .assert()
639− .stdout("hello world\n\nSingle Line\n")
639+ .stdout("File: test.txt\nhello world\n\nFile: single-line.txt\nSingle Line\n")
640640 .stderr("");
641641}
642642