diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-02-18 00:51:44 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-02-18 00:51:44 +0900 |
commit | f5b034095a74ae88410bf3383c39b1e99c0f36a0 (patch) | |
tree | 02bfe6a401a0350b2c7c8fb71dffa40974177303 /src/core.go | |
parent | 95e5beb34e8baa324a3bee59e2705c3c942b5427 (diff) |
Fix race condition in asynchronous -1 and -0
Diffstat (limited to 'src/core.go')
-rw-r--r-- | src/core.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core.go b/src/core.go index 71e3aa96..ea97b4e6 100644 --- a/src/core.go +++ b/src/core.go @@ -149,11 +149,11 @@ func Run(options *Options) { reading = reading && evt == EvtReadNew snapshot, count := chunkList.Snapshot() terminal.UpdateCount(count, !reading) - matcher.Reset(snapshot, terminal.Input(), false) + matcher.Reset(snapshot, terminal.Input(), false, !reading) case EvtSearchNew: snapshot, _ := chunkList.Snapshot() - matcher.Reset(snapshot, terminal.Input(), true) + matcher.Reset(snapshot, terminal.Input(), true, !reading) delay = false case EvtSearchProgress: @@ -170,7 +170,7 @@ func Run(options *Options) { if opts.Select1 && count > 1 || opts.Exit0 && !opts.Select1 && count > 0 { deferred = false terminal.startChan <- true - } else if !reading { + } else if val.final { if opts.Exit0 && count == 0 || opts.Select1 && count == 1 { if opts.PrintQuery { fmt.Println(opts.Query) |