Skip to content
Myr

Remove redundant read event when --sync is used

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent c304fc4 · Browse files · 2 files+11 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+11 added−0 removed

  • other:+11 added−0 removed

2 files+11 added−0 removed

modified:src/util/eventbox.go+7 added
43 unmodified lines
44 }45 b.cond.L.Unlock()46}4748// Unset turns off the event type on the box49func (b *EventBox) Unset(event EventType) {50 b.cond.L.Lock()51 delete(b.events, event)52 b.cond.L.Unlock()53}5455// Clear clears the events56// Unsynchronized; should be called within Wait routine57func (events *Events) Clear() {58 for event := range *events {
45 unmodified lines
modified:src/core.go+4 added
186 unmodified lines
187 // Synchronous search188 if opts.Sync {189 eventBox.Unwatch(EvtReadNew)190 eventBox.WaitFor(EvtReadFin)191 eventBox.Unset(EvtReadNew)192 }193194 // Go interactive195 go matcher.Loop()
20 unmodified lines
216 case EvtReadNew, EvtReadFin:217 reading = reading && evt == EvtReadNew218 snapshot, count := chunkList.Snapshot()219 terminal.UpdateCount(count, !reading, value.(bool))220 if opts.Sync {221 terminal.UpdateList(PassMerger(&snapshot, opts.Tac))222 }223 matcher.Reset(snapshot, terminal.Input(), false, !reading, sort)224225 case EvtSearchNew:226 switch val := value.(type) {
58 unmodified lines