MCPcopy Create free account
hub / github.com/gokcehan/lf / parseArray

Method parseArray

icons.go:107–128  ·  view source on GitHub ↗
(arr []string)

Source from the content-addressed store, hash-verified

105}
106
107func (im *iconMap) parseArray(arr []string) {
108 key := replaceTilde(arr[0])
109
110 if filepath.IsAbs(key) {
111 key = filepath.Clean(key)
112 }
113
114 switch len(arr) {
115 case 1:
116 delete(im.icons, key)
117 case 2:
118 icon := arr[1]
119 if key == "ln" && icon == "target" {
120 im.useLinkTarget = true
121 } else {
122 im.icons[key] = iconWithoutStyle(icon)
123 }
124 case 3:
125 icon, color := arr[1], arr[2]
126 im.icons[key] = iconWithStyle(icon, applySGR(color, tcell.StyleDefault))
127 }
128}
129
130func (im iconMap) get(f *file) iconDef {
131 if val, ok := im.icons[f.path]; ok {

Callers 2

parseFileMethod · 0.95
parseEnvMethod · 0.95

Calls 4

replaceTildeFunction · 0.85
iconWithoutStyleFunction · 0.85
iconWithStyleFunction · 0.85
applySGRFunction · 0.85

Tested by

no test coverage detected