diff options
author | Pierre Peltier <pierre.peltier@adevinta.com> | 2019-12-05 14:10:42 +0100 |
---|---|---|
committer | Abin Simon <abinsimon10@gmail.com> | 2019-12-06 11:35:03 +0530 |
commit | 200c5d2c68c7f0519d1eddfef2e30fe7dd8d11e5 (patch) | |
tree | 71912942ea24c562b082fccc82ce33048a74a42e | |
parent | f344f42bfe67e432ce8838e3bf8d63b21d10122b (diff) |
Fix the spacing rules between the grid and online layout
-rw-r--r-- | src/display.rs | 18 |
1 files 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 |