1
0
Fork 0
gilo/editor/highlight/fn.go

21 lines
420 B
Go
Raw Normal View History

package highlight
2021-04-07 13:10:40 -04:00
import "timshome.page/gilo/terminal"
var syntaxColorMap = map[int]string{
Number: terminal.FGRed,
Match: terminal.FGBlue,
Normal: terminal.DefaultFGColor,
}
2021-04-13 14:54:44 -04:00
// 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
}