@@ -200,13 +200,18 @@ impl<'a> InteractivePrinter<'a> {
203+ fn print_horizontal_line_term(&mut self, handle: &mut dyn Write, style: Style) -> Result<()> {
207+ style.paint("─".repeat(self.config.term_width))
203 fn print_horizontal_line(&mut self, handle: &mut dyn Write, grid_char: char) -> Result<()> {
212 fn print_horizontal_line(&mut self, handle: &mut dyn Write, grid_char: char) -> Result<()> {
204 if self.panel_width == 0 {
213 if self.panel_width == 0 {
205− writeln!(
214+ self.print_horizontal_line_term(handle, self.colors.grid)?;
208− self.colors.grid.paint("─".repeat(self.config.term_width))
211 let hline = "─".repeat(self.config.term_width - (self.panel_width + 1));
216 let hline = "─".repeat(self.config.term_width - (self.panel_width + 1));
212 let hline = format!("{}{}{}", "─".repeat(self.panel_width), grid_char, hline);
217 let hline = format!("{}{}{}", "─".repeat(self.panel_width), grid_char, hline);
@@ -251,6 +256,10 @@ impl<'a> Printer for InteractivePrinter<'a> {
251 input: &OpenedInput,
256 input: &OpenedInput,
252 add_header_padding: bool,
257 add_header_padding: bool,
253 ) -> Result<()> {
258 ) -> Result<()> {
259+ if add_header_padding && self.config.style_components.rule() {
260+ self.print_horizontal_line_term(handle, self.colors.rule)?;
254 if !self.config.style_components.header() {
263 if !self.config.style_components.header() {
255 if Some(ContentType::BINARY) == self.content_type && !self.config.show_nonprintable {
264 if Some(ContentType::BINARY) == self.content_type && !self.config.show_nonprintable {
256 writeln!(
265 writeln!(
@@ -279,7 +288,8 @@ impl<'a> Printer for InteractivePrinter<'a> {
279 .paint(if self.panel_width > 0 { "│ " } else { "" }),
288 .paint(if self.panel_width > 0 { "│ " } else { "" }),
291+ // Only pad space between files, if we haven't already drawn a horizontal rule
282− if add_header_padding {
292+ if add_header_padding && !self.config.style_components.rule() {
283 writeln!(handle)?;
293 writeln!(handle)?;
285 write!(handle, "{}", " ".repeat(self.panel_width))?;
295 write!(handle, "{}", " ".repeat(self.panel_width))?;
@@ -603,6 +613,7 @@ const DEFAULT_GUTTER_COLOR: u8 = 238;
603#[derive(Debug, Default)]
613#[derive(Debug, Default)]
604pub struct Colors {
614pub struct Colors {
605 pub grid: Style,
615 pub grid: Style,
606 pub filename: Style,
617 pub filename: Style,
607 pub git_added: Style,
618 pub git_added: Style,
608 pub git_removed: Style,
619 pub git_removed: Style,
@@ -624,6 +635,7 @@ impl Colors {
626 grid: gutter_color.normal(),
637 grid: gutter_color.normal(),
638+ rule: gutter_color.normal(),
627 filename: Style::new().bold(),
639 filename: Style::new().bold(),
628 git_added: Green.normal(),
640 git_added: Green.normal(),
629 git_removed: Red.normal(),
641 git_removed: Red.normal(),