(arr []string)
| 105 | } |
| 106 | |
| 107 | func (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 | |
| 130 | func (im iconMap) get(f *file) iconDef { |
| 131 | if val, ok := im.icons[f.path]; ok { |
no test coverage detected