Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

file_icons: Resolve icon properly for exact file name match (#24396)

Finn Eversffcad71bfabe
diff --git a/crates/file_icons/src/file_icons.rs b/crates/file_icons/src/file_icons.rs
index 88b20036352..37b0a6b225a 100644
--- a/crates/file_icons/src/file_icons.rs
+++ b/crates/file_icons/src/file_icons.rs
@@ -54,7 +54,7 @@ impl FileIcons {
// check if file name is in suffixes
// e.g. catch file named `eslint.config.js` instead of `.eslint.config.js`
- if let Some(typ) = path.to_str().and_then(|typ| this.suffixes.get(typ)) {
+ if let Some(typ) = path.file_name().and_then(|typ| typ.to_str()) {
let maybe_path = get_icon_from_suffix(typ);
if maybe_path.is_some() {
return maybe_path;