package highlight import "timshome.page/gilo/terminal" var syntaxColorMap = map[int]string{ Number: terminal.FGRed, Match: terminal.FGBlue, Normal: terminal.DefaultFGColor, } // SyntaxToColor Take a highlighting type and map it to // an ANSI color escape code for display func SyntaxToColor(hl int) string { color := syntaxColorMap[hl] if len(color) == 0 { color = terminal.DefaultFGColor } return color }