Merge pull request 'Add missing ansi translations' (#78) from Seanstoppable/cview:addmissingansitranslations into master

Reviewed-on: https://code.rocketnine.space/tslocum/cview/pulls/78
This commit is contained in:
tslocum 2021-10-04 20:04:42 -07:00
commit 10ad6ee7dd
1 changed files with 12 additions and 0 deletions

12
ansi.go
View File

@ -135,6 +135,10 @@ func (a *ansi) Write(text []byte) (int, error) {
if strings.IndexRune(a.attributes, 'd') < 0 {
a.attributes += "d"
}
case "3", "03":
if strings.IndexRune(a.attributes, 'i') < 0 {
a.attributes += "i"
}
case "4", "04":
if strings.IndexRune(a.attributes, 'u') < 0 {
a.attributes += "u"
@ -143,6 +147,14 @@ func (a *ansi) Write(text []byte) (int, error) {
if strings.IndexRune(a.attributes, 'l') < 0 {
a.attributes += "l"
}
case "7", "07":
if strings.IndexRune(a.attributes, 'r') < 0 {
a.attributes += "r"
}
case "9", "09":
if strings.IndexRune(a.attributes, 's') < 0 {
a.attributes += "s"
}
case "22":
if i := strings.IndexRune(a.attributes, 'b'); i >= 0 {
a.attributes = a.attributes[:i] + a.attributes[i+1:]