diff --git a/src/icon.rs b/src/icon.rs index f7cdf14..25affc4 100644 --- a/src/icon.rs +++ b/src/icon.rs @@ -58,11 +58,37 @@ impl Icons { let mut res = String::with_capacity(4 + ICON_SPACE.len()); // 4 == max icon size - // Check directory. - if let FileType::Directory { .. } = name.file_type() { + // Check file types + let file_type: FileType = name.file_type(); + + if let FileType::Directory { .. } = file_type { res += self.default_folder_icon; res += ICON_SPACE; return res; + } else if let FileType::SymLink = file_type { + res += "\u{e27c}"; // "" + res += ICON_SPACE; + return res; + } else if let FileType::Socket = file_type { + res += "\u{f6a7}"; // "" + res += ICON_SPACE; + return res; + } else if let FileType::Pipe = file_type { + res += "\u{f731}"; // "" + res += ICON_SPACE; + return res; + } else if let FileType::CharDevice = file_type { + res += "\u{e601}"; // "" + res += ICON_SPACE; + return res; + } else if let FileType::BlockDevice = file_type { + res += "\u{fc29}"; // "ﰩ" + res += ICON_SPACE; + return res; + } else if let FileType::Special = file_type { + res += "\u{f2dc}"; // "" + res += ICON_SPACE; + return res; } // Check the known names. diff --git a/src/meta/name.rs b/src/meta/name.rs index 7c784f4..36db470 100644 --- a/src/meta/name.rs +++ b/src/meta/name.rs @@ -175,7 +175,7 @@ mod test { let name = Name::new(&symlink_path, file_type); assert_eq!( - Colour::Fixed(44).paint(" target.tmp"), + Colour::Fixed(44).paint(" target.tmp"), name.render(&colors, &icons) ); } @@ -201,7 +201,7 @@ mod test { let name = Name::new(&pipe_path, file_type); assert_eq!( - Colour::Fixed(184).paint(" pipe.tmp"), + Colour::Fixed(184).paint(" pipe.tmp"), name.render(&colors, &icons) ); }