Skip to content

Commit

Permalink
Add italics support for truecolour terminals
Browse files Browse the repository at this point in the history
  • Loading branch information
Ray Lee authored and alecthomas committed Sep 1, 2019
1 parent 6a3320f commit f2e0513
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions formatters/tty_truecolour.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ func trueColourFormatter(w io.Writer, style *chroma.Style, it chroma.Iterator) e
if entry.Underline == chroma.Yes {
out += "\033[4m"
}
if entry.Italic == chroma.Yes {
out += "\033[3m"
}
if entry.Colour.IsSet() {
out += fmt.Sprintf("\033[38;2;%d;%d;%dm", entry.Colour.Red(), entry.Colour.Green(), entry.Colour.Blue())
}
Expand Down

0 comments on commit f2e0513

Please sign in to comment.