summaryrefslogtreecommitdiffstats
path: root/src/core.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-08-20 14:29:50 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-08-20 14:30:17 +0900
commit55ee4186aa688e524e041971d588a6f002486deb (patch)
treeea7134fc3d228e0a2cdf8fd2f80f76cf8dc01a03 /src/core.go
parent941b0a0ff7c15f7cd51f8f6b4e9a64fd48902ef5 (diff)
Ignore EvtReadNew if EvtReadFin is already set
Diffstat (limited to 'src/core.go')
-rw-r--r--src/core.go4
1 files changed, 3 insertions, 1 deletions
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 {