fix order of color/icon matches

cc #543
This commit is contained in:
Gokcehan committed 2021-01-03 01:02:40 +03:00
1 parent 1e94f4533e
commit bfa527fcea
5 files changed
+98 -59

No files matched your search

+16 -14
View File
@@ -74,18 +74,6 @@ func (im iconMap) get(f *file) string {
}
}
if val, ok := im[f.Name()]; ok {
return val
}
if val, ok := im[filepath.Base(f.Name())+".*"]; ok {
return val
}
if val, ok := im["*"+f.ext]; ok {
return val
}
var key string
switch {
@@ -115,13 +103,27 @@ func (im iconMap) get(f *file) string {
key = "sg"
case f.Mode()&0111 != 0:
key = "ex"
default:
key = "fi"
}
if val, ok := im[key]; ok {
return val
}
if val, ok := im[f.Name()]; ok {
return val
}
if val, ok := im[filepath.Base(f.Name())+".*"]; ok {
return val
}
if val, ok := im["*"+f.ext]; ok {
return val
}
if val, ok := im["fi"]; ok {
return val
}
return " "
}