If screen.Redraw() is called very quickly after a key or mouse event,
it may send the redraw event while micro is not waiting for it but
still processing the key or mouse event. Since drawChan is non-buffered
and at the same time non-blocking, this redraw event will be simply lost,
so the screen content will not be up-to-date.
case <-shell.CloseTerms:
case event = <-events:
case <-screen.DrawChan():
+ for len(screen.DrawChan()) > 0 {
+ <-screen.DrawChan()
+ }
}
if action.InfoBar.HasPrompt {
// Init creates and initializes the tcell screen
func Init() {
- drawChan = make(chan bool)
+ drawChan = make(chan bool, 8)
// Should we enable true color?
truecolor := os.Getenv("MICRO_TRUECOLOR") == "1"