1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-21 00:30:00 +02:00

Add color functions to templates funcMaps

This commit is contained in:
Elwardi
2021-08-09 11:52:00 +01:00
parent b5d8849c06
commit e8e4fa5957
3 changed files with 12 additions and 7 deletions

View File

@ -136,10 +136,7 @@ func (gui *Gui) GenerateMenuCandidates(commandOutput, filter, valueFormat, label
return nil, gui.surfaceError(errors.New("unable to parse value format, error: " + err.Error()))
}
colorFuncMap := template.FuncMap{}
for k, v := range style.ColorMap {
colorFuncMap[k] = v.Foreground.Sprint
}
colorFuncMap := style.TemplateFuncMapAddColors(template.FuncMap{})
descTemp, err := template.New("format").Funcs(colorFuncMap).Parse(labelFormat)
if err != nil {