mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-24 17:50:15 +09:00
Fix dropped redraw events (#1675)
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.
This commit is contained in:
@@ -363,6 +363,9 @@ func DoEvent() {
|
||||
case <-shell.CloseTerms:
|
||||
case event = <-events:
|
||||
case <-screen.DrawChan():
|
||||
for len(screen.DrawChan()) > 0 {
|
||||
<-screen.DrawChan()
|
||||
}
|
||||
}
|
||||
|
||||
if action.InfoBar.HasPrompt {
|
||||
|
||||
Reference in New Issue
Block a user