gilo/editor/highlight/fn.go
Timothy Warren 0569ede1a5
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good
Comments and import fixes
2021-04-13 14:54:44 -04:00

21 lines
420 B
Go

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
}