Permalink
Browse files

Add an explicit AttrBlink

Passing AttrBold to the background causes blinking. This is undocumented
and unexpected. Make a new attribute AttrBlink instead, and observe this
attribute on either fg or bg (just like AttrReverse).
  • Loading branch information...
1 parent b16c3af commit 6522df5cc0d8d30e495e04504ce467198c02a138 @kballard committed Apr 12, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −0 api_common.go
  2. +1 −1 termbox.go
View
@@ -129,6 +129,7 @@ const (
AttrBold Attribute = 1 << (iota + 4)
AttrUnderline
AttrReverse
+ AttrBlink
)
// Input mode. See SetInputMode function.
View
@@ -123,7 +123,7 @@ func send_attr(fg, bg Attribute) {
if fg&AttrBold != 0 {
outbuf.WriteString(funcs[t_bold])
}
- if bg&AttrBold != 0 {
+ if fg&AttrBlink|bg&AttrBlink != 0 {
outbuf.WriteString(funcs[t_blink])
}
if fg&AttrUnderline != 0 {

0 comments on commit 6522df5

Please sign in to comment.