From 55ee4186aa688e524e041971d588a6f002486deb Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 20 Aug 2017 14:29:50 +0900 Subject: Ignore EvtReadNew if EvtReadFin is already set --- src/core.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/core.go') diff --git a/src/core.go b/src/core.go index 1c8182ea..023f7be7 100644 --- a/src/core.go +++ b/src/core.go @@ -188,7 +188,6 @@ func Run(opts *Options, revision string) { if opts.Sync { eventBox.Unwatch(EvtReadNew) eventBox.WaitFor(EvtReadFin) - eventBox.Unset(EvtReadNew) } // Go interactive @@ -210,6 +209,9 @@ func Run(opts *Options, revision string) { delay := true ticks++ eventBox.Wait(func(events *util.Events) { + if _, fin := (*events)[EvtReadFin]; fin { + delete(*events, EvtReadNew) + } for evt, value := range *events { switch evt { -- cgit v1.2.3