mirror of
https://github.com/lsd-rs/lsd
synced 2024-11-10 14:24:27 +00:00
Improve the icons detection
This commit is contained in:
parent
6bab5a75b6
commit
b71204e158
1 changed files with 6 additions and 2 deletions
|
@ -19,13 +19,17 @@ impl Formatter {
|
|||
let mut content = String::new();
|
||||
|
||||
let color = if meta.metadata.is_dir() {
|
||||
content = content + Logo::folder().as_str() + " " + &meta.name;
|
||||
Colors[&Elem::Dir]
|
||||
} else {
|
||||
content = content + Logo::from_pathbuf(&meta.path).as_str() + " " + &meta.name;
|
||||
Colors[&Elem::UnrecognizedFile]
|
||||
};
|
||||
|
||||
let mut name = meta.name.clone();
|
||||
if meta.metadata.is_dir() {
|
||||
name.push('/');
|
||||
}
|
||||
|
||||
content = content + Logo::from_meta(&meta).as_str() + " " + &name;
|
||||
content = color.paint(content).to_string();
|
||||
|
||||
content
|
||||
|
|
Loading…
Reference in a new issue