fixes #23 Fifo overfull hang

This commit is contained in:
Garrett D'Amore 2015-10-05 01:27:55 -07:00
parent b8c3aaddbc
commit 4a014d05f5
4 changed files with 38 additions and 36 deletions

View File

@ -70,7 +70,6 @@ func Puts(s tcell.Screen, style tcell.Style, x, y int, str string) {
func main() {
s, e := tcell.NewScreen()
if e != nil {
fmt.Fprintf(os.Stderr, "%v\n", e)
@ -125,7 +124,7 @@ func main() {
tcell.RuneVLine,
tcell.RuneLantern,
tcell.RuneVLine,
}) + " (bullet, lantern/section)")
})+" (bullet, lantern/section)")
Putln(s, string([]rune{
tcell.RuneLTee,
tcell.RuneHLine,
@ -139,7 +138,7 @@ func main() {
tcell.RuneVLine,
tcell.RuneUArrow,
tcell.RuneVLine,
}) + " (diamond, up arrow)")
})+" (diamond, up arrow)")
Putln(s, string([]rune{
tcell.RuneLLCorner,
tcell.RuneHLine,

View File

@ -27,7 +27,7 @@ import (
)
func Register() {
tcell.RegisterEncoding("ISO8859-1", charmap.ISO8859_15) // alias for now
tcell.RegisterEncoding("ISO8859-1", charmap.ISO8859_15) // alias for now
tcell.RegisterEncoding("ISO8859-13", charmap.ISO8859_13)
tcell.RegisterEncoding("ISO8859-14", charmap.ISO8859_14)
tcell.RegisterEncoding("ISO8859-15", charmap.ISO8859_15)
@ -59,37 +59,37 @@ func Register() {
// Common aliaess
aliases := map[string]string{
"8859-1": "ISO8859-1",
"ISO-8859-1": "ISO8859-1",
"8859-13": "ISO8859-13",
"ISO-8859-13": "ISO8859-13",
"8859-14": "ISO8859-14",
"ISO-8859-14": "ISO8859-14",
"8859-15": "ISO8859-15",
"ISO-8859-15": "ISO8859-15",
"8859-16": "ISO8859-16",
"ISO-8859-16": "ISO8859-16",
"8859-2": "ISO8859-2",
"ISO-8859-2": "ISO8859-2",
"8859-3": "ISO8859-3",
"ISO-8859-3": "ISO8859-3",
"8859-4": "ISO8859-4",
"ISO-8859-4": "ISO8859-4",
"8859-5": "ISO8859-5",
"ISO-8859-5": "ISO8859-5",
"8859-6": "ISO8859-6",
"ISO-8859-6": "ISO8859-6",
"8859-7": "ISO8859-7",
"ISO-8859-7": "ISO8859-7",
"8859-8": "ISO8859-8",
"ISO-8859-8": "ISO8859-8",
"8859-1": "ISO8859-1",
"ISO-8859-1": "ISO8859-1",
"8859-13": "ISO8859-13",
"ISO-8859-13": "ISO8859-13",
"8859-14": "ISO8859-14",
"ISO-8859-14": "ISO8859-14",
"8859-15": "ISO8859-15",
"ISO-8859-15": "ISO8859-15",
"8859-16": "ISO8859-16",
"ISO-8859-16": "ISO8859-16",
"8859-2": "ISO8859-2",
"ISO-8859-2": "ISO8859-2",
"8859-3": "ISO8859-3",
"ISO-8859-3": "ISO8859-3",
"8859-4": "ISO8859-4",
"ISO-8859-4": "ISO8859-4",
"8859-5": "ISO8859-5",
"ISO-8859-5": "ISO8859-5",
"8859-6": "ISO8859-6",
"ISO-8859-6": "ISO8859-6",
"8859-7": "ISO8859-7",
"ISO-8859-7": "ISO8859-7",
"8859-8": "ISO8859-8",
"ISO-8859-8": "ISO8859-8",
"SJIS": "Shift_JIS",
"eucJP": "EUC-JP",
"2022-JP": "ISO2022JP",
"ISO-2022-JP": "ISO2022JP",
"SJIS": "Shift_JIS",
"eucJP": "EUC-JP",
"2022-JP": "ISO2022JP",
"ISO-2022-JP": "ISO2022JP",
"eucKR": "EUC-KR",
"eucKR": "EUC-KR",
}
for n, v := range aliases {
tcell.RegisterEncoding(n, tcell.GetEncoding(v))

View File

@ -86,7 +86,7 @@ type tScreen struct {
}
func (t *tScreen) Init() error {
t.evch = make(chan Event, 2)
t.evch = make(chan Event, 10)
t.indoneq = make(chan struct{})
t.charset = "UTF-8"
@ -597,7 +597,11 @@ func (t *tScreen) buildAcsMap() {
}
func (t *tScreen) PostEvent(ev Event) {
t.evch <- ev
select {
case t.evch <- ev:
default:
// drop the event on the floor
}
}
func (t *tScreen) postMouseEvent(x, y, btn int) {

View File

@ -38,7 +38,6 @@ func (t *tScreen) getWinSize() (int, int, error) {
return 0, 0, errors.New("no temrios on Windows")
}
func (t *tScreen) getCharset() string {
return "UTF-16LE"
}