Skip to content

Commit 0f928b0

Browse files
committed
enhance loading
1 parent fbebdfb commit 0f928b0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/fileicon/icon.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ func getBasicFileIconName(entry *git.TreeEntry) string {
3636

3737
func getFileIconNames(entry *git.TreeEntry) []string {
3838
if entry.IsDir() {
39-
return []string{"directory"}
39+
fileName := strings.ToLower(path.Base(entry.Name()))
40+
return []string{fileName, "directory"}
4041
}
4142

4243
if entry.IsRegular() {
4344
fileName := strings.ToLower(path.Base(entry.Name()))
4445
ext := strings.ToLower(strings.TrimPrefix(path.Ext(fileName), "."))
45-
return []string{fileName, ext}
46+
return []string{fileName, ext, "file"}
4647
}
4748

4849
return nil

0 commit comments

Comments
 (0)