From de691bf4e870f6c236774f493e1dc80f521d9e17 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Thu, 24 Dec 2020 01:04:13 +0300 Subject: [PATCH] match trailing slash as dirs in colors/icons Related #505 #506 --- colors.go | 10 ++++++++++ icons.go | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/colors.go b/colors.go index ced3ffcd..6d90e20c 100644 --- a/colors.go +++ b/colors.go @@ -197,6 +197,16 @@ func (cm styleMap) get(f *file) tcell.Style { return val } + if f.IsDir() { + if val, ok := cm[f.Name()+"/"]; ok { + return val + } + } + + if val, ok := cm[f.Name()]; ok { + return val + } + if val, ok := cm[f.Name()]; ok { return val } diff --git a/icons.go b/icons.go index c8ba854c..6023f4f1 100644 --- a/icons.go +++ b/icons.go @@ -50,6 +50,12 @@ func (im iconMap) get(f *file) string { return val } + if f.IsDir() { + if val, ok := im[f.Name()+"/"]; ok { + return val + } + } + if val, ok := im[f.Name()]; ok { return val }