From 200c5d2c68c7f0519d1eddfef2e30fe7dd8d11e5 Mon Sep 17 00:00:00 2001 From: Pierre Peltier Date: Thu, 5 Dec 2019 14:10:42 +0100 Subject: Fix the spacing rules between the grid and online layout --- src/display.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/display.rs b/src/display.rs index ffb2cb0..93179d8 100644 --- a/src/display.rs +++ b/src/display.rs @@ -37,14 +37,16 @@ fn inner_display_grid( let mut output = String::new(); let padding_rules = get_padding_rules(&metas, flags); - let mut grid = Grid::new(GridOptions { - filling: Filling::Spaces(2), - direction: if flags.layout == Layout::OneLine { - Direction::LeftToRight - } else { - Direction::TopToBottom - }, - }); + let mut grid = match flags.layout { + Layout::OneLine => Grid::new(GridOptions { + filling: Filling::Spaces(1), + direction: Direction::LeftToRight, + }), + _ => Grid::new(GridOptions { + filling: Filling::Spaces(2), + direction: Direction::TopToBottom, + }), + }; // The first iteration (depth == 0) corresponds to the inputs given by the // user. We defer displaying directories given by the user unless we've been -- cgit v1.2.3