mirror of
https://github.com/alecthomas/chroma.git
synced 2025-07-05 00:38:52 +02:00
Add italics support for truecolour terminals
This commit is contained in:
@ -21,6 +21,9 @@ func trueColourFormatter(w io.Writer, style *chroma.Style, it chroma.Iterator) e
|
|||||||
if entry.Underline == chroma.Yes {
|
if entry.Underline == chroma.Yes {
|
||||||
out += "\033[4m"
|
out += "\033[4m"
|
||||||
}
|
}
|
||||||
|
if entry.Italic == chroma.Yes {
|
||||||
|
out += "\033[3m"
|
||||||
|
}
|
||||||
if entry.Colour.IsSet() {
|
if entry.Colour.IsSet() {
|
||||||
out += fmt.Sprintf("\033[38;2;%d;%d;%dm", entry.Colour.Red(), entry.Colour.Green(), entry.Colour.Blue())
|
out += fmt.Sprintf("\033[38;2;%d;%d;%dm", entry.Colour.Red(), entry.Colour.Green(), entry.Colour.Blue())
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user