mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-05 20:37:52 +00:00
Fix bug where errors' tree parts ended early
Have to collect the results into a Vec in order to make sure we only do the ending part for the last one.
This commit is contained in:
parent
2a9b6fe930
commit
2741c19e93
@ -105,10 +105,12 @@ impl Details {
|
|||||||
Some(Ok(ref dir)) => {
|
Some(Ok(ref dir)) => {
|
||||||
let mut files = Vec::new();
|
let mut files = Vec::new();
|
||||||
|
|
||||||
for file_to_add in dir.files(true) {
|
let files_to_add = dir.files(true).collect::<Vec<_>>();
|
||||||
|
let child_count = files_to_add.len();
|
||||||
|
for (index, file_to_add) in files_to_add.into_iter().enumerate() {
|
||||||
match file_to_add {
|
match file_to_add {
|
||||||
Ok(f) => files.push(f),
|
Ok(f) => files.push(f),
|
||||||
Err((path, e)) => table.add_error(&e, depth + 1, false, Some(&*path)),
|
Err((path, e)) => table.add_error(&e, depth + 1, index == child_count - 1 && files.is_empty(), Some(&*path)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user