Skip to content

Commit

Permalink
flush the gui before polling for any events
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseduffield authored and mjarkk committed Apr 27, 2019
1 parent a80ffd8 commit 6c1b364
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ func (g *Gui) SetManagerFunc(manager func(*Gui) error) {
// MainLoop runs the main loop until an error is returned. A successful
// finish should return ErrQuit.
func (g *Gui) MainLoop() error {
if err := g.flush(); err != nil {
return err
}
go func() {
for {
g.tbEvents <- termbox.PollEvent()
Expand Down

0 comments on commit 6c1b364

Please sign in to comment.