Add support for bold text. (#106)

Currently, bold text isn't supported. This adds the support for bold
text formatting.
This commit is contained in:
Jelmer Snoeck 2017-10-02 04:59:06 +01:00 committed by chzyer
parent 707fd8ecaa
commit c6c3e8d906
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,7 @@ const (
COLOR_BINTENSITY = 0x0080
COMMON_LVB_UNDERSCORE = 0x8000
COMMON_LVB_BOLD = 0x0007
)
var ColorTableFg = []word{
@ -163,6 +164,8 @@ func (a *ANSIWriterCtx) ioloopEscSeq(w *bufio.Writer, r rune, argptr *[]string)
color |= ColorTableBg[c-40]
} else if c == 4 {
color |= COMMON_LVB_UNDERSCORE | ColorTableFg[7]
} else if c == 1 {
color |= COMMON_LVB_BOLD | COLOR_FINTENSITY
} else { // unknown code treat as reset
color = ColorTableFg[7]
}