Browse Source

Fixed wrong handling of 8-bit ANSI colors. Fixes #317

tablepad
Oliver 3 years ago
parent
commit
0e689965bb
  1. 2
      ansi.go
  2. 2
      application.go

2
ansi.go

@ -127,6 +127,7 @@ func (a *ansi) Write(text []byte) (int, error) { @@ -127,6 +127,7 @@ func (a *ansi) Write(text []byte) (int, error) {
"#ffffff",
}[colorNumber]
}
FieldLoop:
for index, field := range fields {
switch field {
case "1", "01":
@ -185,6 +186,7 @@ func (a *ansi) Write(text []byte) (int, error) { @@ -185,6 +186,7 @@ func (a *ansi) Write(text []byte) (int, error) {
background = color
}
}
break FieldLoop
}
}
if len(attributes) > 0 || clearAttributes {

2
application.go

@ -81,7 +81,7 @@ func NewApplication() *Application { @@ -81,7 +81,7 @@ func NewApplication() *Application {
//
// Note that this also affects the default event handling of the application
// itself: Such a handler can intercept the Ctrl-C event which closes the
// applicatoon.
// application.
func (a *Application) SetInputCapture(capture func(event *tcell.EventKey) *tcell.EventKey) *Application {
a.inputCapture = capture
return a

Loading…
Cancel
Save