summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeltoche <dev@halium.fr>2018-12-14 16:50:03 +0100
committerPierre Peltier <dev@halium.fr>2018-12-14 17:07:52 +0100
commit0c877b1cdbfd43a3e311aadd0d447c86aa446227 (patch)
treebbbae932600f2b59e7626258e2089b395851d8f6
parentd781e49c679482044de996382aaf0aecf996a917 (diff)
Fix a multi icon issue
-rw-r--r--src/icon.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/icon.rs b/src/icon.rs
index 7f36bf1..adada7e 100644
--- a/src/icon.rs
+++ b/src/icon.rs
@@ -38,23 +38,24 @@ impl Icons {
// Check the known names.
if let Some(icon) = self.icons_by_name.get(name.name().as_str()) {
res += icon;
+ res += ICON_SPACE;
+ return res;
}
- // Check the known extensions.
+ // Check the known extensions.
if let Some(extension) = name.extension() {
if let Some(icon) = self.icons_by_extension.get(extension.as_str()) {
res += icon;
+ res += ICON_SPACE;
+ return res;
}
}
- if res.is_empty() {
- // Use the default icons.
- res += match name.file_type() {
- FileType::Directory => "\u{f115}", // 
- _ => "\u{f016}", // 
- };
- }
-
+ // Use the default icons.
+ res += match name.file_type() {
+ FileType::Directory => "\u{f115}", // 
+ _ => "\u{f016}", // 
+ };
res += ICON_SPACE;
res
}