diff --git a/pkg/style/path.go b/pkg/style/path.go index f81dfed29..69bf45993 100644 --- a/pkg/style/path.go +++ b/pkg/style/path.go @@ -28,6 +28,13 @@ func ForPathExt(path string, sc Context) string { return fromSGR(lscolors.GetColorist(sc.Getenv("LS_COLORS")).GetStyleExt(path)) } +// ForExtension returns the style for given extension +// +// json +func ForExtension(path string, sc Context) string { + return ForPathExt("."+path, sc) +} + func fromSGR(sgr string) string { s := ui.StyleFromSGR(sgr) result := []string{}