// clear the drawchan so we don't redraw excessively
// if someone requested a redraw before we started displaying
- for len(screen.DrawChan) > 0 {
- <-screen.DrawChan
+ for len(screen.DrawChan()) > 0 {
+ <-screen.DrawChan()
}
// wait for initial resize event
}
case <-shell.CloseTerms:
case event = <-events:
- case <-screen.DrawChan:
+ case <-screen.DrawChan():
}
if action.InfoBar.HasPrompt {
// The lock is necessary since the screen is polled on a separate thread
var lock sync.Mutex
-// DrawChan is a channel that will cause the screen to redraw when
+// drawChan is a channel that will cause the screen to redraw when
// written to even if no event user event has occurred
-var DrawChan chan bool
+var drawChan chan bool
// Lock locks the screen lock
func Lock() {
// Redraw schedules a redraw with the draw channel
func Redraw() {
select {
- case DrawChan <- true:
+ case drawChan <- true:
default:
// channel is full
}
}
+// DrawChan returns the draw channel
+func DrawChan() chan bool {
+ return drawChan
+}
+
type screenCell struct {
x, y int
r rune
// Init creates and initializes the tcell screen
func Init() {
- DrawChan = make(chan bool)
+ drawChan = make(chan bool)
// Should we enable true color?
truecolor := os.Getenv("MICRO_TRUECOLOR") == "1"