mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-12-25 17:51:10 +00:00
Stop adding spaces to the end of each line
This left-aligns the final column, but the final column is the file name, so that's okay.
This commit is contained in:
parent
8b68d699db
commit
355ca51617
13
exa.rs
13
exa.rs
@ -71,15 +71,18 @@ fn exa(options: &Options, path: Path) {
|
|||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
for (field_lengths, row) in lengths.iter().zip(table.iter()) {
|
for (field_lengths, row) in lengths.iter().zip(table.iter()) {
|
||||||
let mut first = true;
|
for (((column_length, cell), field_length), (num, column)) in column_widths.iter().zip(row.iter()).zip(field_lengths.iter()).zip(options.columns.iter().enumerate()) { // this is getting messy
|
||||||
for (((column_length, cell), field_length), column) in column_widths.iter().zip(row.iter()).zip(field_lengths.iter()).zip(options.columns.iter()) { // this is getting messy
|
if num != 0 {
|
||||||
if first {
|
|
||||||
first = false;
|
|
||||||
} else {
|
|
||||||
print!(" ");
|
print!(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if num == options.columns.len() - 1 {
|
||||||
|
print!("{}", cell);
|
||||||
|
}
|
||||||
|
else {
|
||||||
print!("{}", column.alignment().pad_string(cell, *field_length, *column_length));
|
print!("{}", column.alignment().pad_string(cell, *field_length, *column_length));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
print!("\n");
|
print!("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user