Don't block when redraw channel becomes full

Fixes #1497
This commit is contained in:
Zachary Yedidia
2020-02-11 20:03:32 -05:00
parent d7e3fc99f1
commit 8224037080
6 changed files with 12 additions and 8 deletions

View File

@@ -37,7 +37,11 @@ func Unlock() {
// Redraw schedules a redraw with the draw channel
func Redraw() {
DrawChan <- true
select {
case DrawChan <- true:
default:
// channel is full
}
}
type screenCell struct {
@@ -118,7 +122,7 @@ func TempStart(screenWasNil bool) {
// Init creates and initializes the tcell screen
func Init() {
DrawChan = make(chan bool, 8)
DrawChan = make(chan bool)
// Should we enable true color?
truecolor := os.Getenv("MICRO_TRUECOLOR") == "1"