Skip to content

Commit f2e0513

Browse files
Ray Leealecthomas
authored andcommitted
Add italics support for truecolour terminals
1 parent 6a3320f commit f2e0513

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

formatters/tty_truecolour.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ func trueColourFormatter(w io.Writer, style *chroma.Style, it chroma.Iterator) e
2121
if entry.Underline == chroma.Yes {
2222
out += "\033[4m"
2323
}
24+
if entry.Italic == chroma.Yes {
25+
out += "\033[3m"
26+
}
2427
if entry.Colour.IsSet() {
2528
out += fmt.Sprintf("\033[38;2;%d;%d;%dm", entry.Colour.Red(), entry.Colour.Green(), entry.Colour.Blue())
2629
}

0 commit comments

Comments
 (0)