]> git.lizzy.rs Git - micro.git/commitdiff
Fix race condition with events channel
authorZachary Yedidia <zyedidia@gmail.com>
Sun, 29 Dec 2019 23:53:59 +0000 (18:53 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Sun, 29 Dec 2019 23:53:59 +0000 (18:53 -0500)
cmd/micro/micro.go

index 94ea6383de487680681630fbe54beedd2df9d39c..1b28bde2a030fcd24533058fe2bbcb8b4ddb7b7d 100644 (file)
@@ -211,9 +211,10 @@ func main() {
        action.InitTabs(b)
        action.InitGlobals()
 
+       events = make(chan tcell.Event)
+
        // Here is the event loop which runs in a separate thread
        go func() {
-               events = make(chan tcell.Event)
                for {
                        screen.Lock()
                        e := screen.Screen.PollEvent()