mirror of
https://github.com/rivo/tview.git
synced 2025-04-24 13:48:56 +08:00
Fixed wrong handling of 8-bit ANSI colors. Fixes #317
This commit is contained in:
parent
fc28d646d0
commit
0e689965bb
2
ansi.go
2
ansi.go
@ -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) {
|
||||
background = color
|
||||
}
|
||||
}
|
||||
break FieldLoop
|
||||
}
|
||||
}
|
||||
if len(attributes) > 0 || clearAttributes {
|
||||
|
@ -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…
x
Reference in New Issue
Block a user