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 -18
View File
@@ -233,22 +233,6 @@ func (sm styleMap) get(f *file) tcell.Style {
}
}
if val, ok := sm[f.Name()]; ok {
return val
}
if val, ok := sm[f.Name()]; ok {
return val
}
if val, ok := sm[filepath.Base(f.Name())+".*"]; ok {
return val
}
if val, ok := sm["*"+f.ext]; ok {
return val
}
var key string
switch {
@@ -278,13 +262,27 @@ func (sm styleMap) get(f *file) tcell.Style {
key = "sg"
case f.Mode()&0111 != 0:
key = "ex"
default:
key = "fi"
}
if val, ok := sm[key]; ok {
return val
}
if val, ok := sm[f.Name()]; ok {
return val
}
if val, ok := sm[filepath.Base(f.Name())+".*"]; ok {
return val
}
if val, ok := sm["*"+f.ext]; ok {
return val
}
if val, ok := sm["fi"]; ok {
return val
}
return tcell.StyleDefault
}