Remove unnecessary delay on non/defered interactive mode

This commit is contained in:
Junegunn Choi
2015-01-04 05:00:28 +09:00
parent 0a6cb62169
commit 0dd024a09f
3 changed files with 77 additions and 3 deletions

View File

@@ -77,6 +77,7 @@ func Run(options *Options) {
pattern := patternBuilder([]rune(patternString))
looping := true
eventBox.Unwatch(EVT_READ_NEW)
for looping {
eventBox.Wait(func(events *Events) {
for evt, _ := range *events {
@@ -87,7 +88,6 @@ func Run(options *Options) {
}
}
})
time.Sleep(COORDINATOR_DELAY)
}
matches, cancelled := matcher.scan(MatchRequest{
@@ -116,6 +116,7 @@ func Run(options *Options) {
// Event coordination
reading := true
ticks := 0
eventBox.Watch(EVT_READ_NEW)
for {
delay := true
ticks += 1