diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-01-12 12:56:17 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-01-12 12:56:17 +0900 |
commit | cd847affb79ea6438c9721635724efc6f58e2215 (patch) | |
tree | d1e631e3dca8832ee4c495924789f6697c3629cf /src/core.go | |
parent | 7a2bc2cada971c7a390d09b0afda34780ff56fb6 (diff) |
Reorganize source code
Diffstat (limited to 'src/core.go')
-rw-r--r-- | src/core.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core.go b/src/core.go index 65e641c2..ee904135 100644 --- a/src/core.go +++ b/src/core.go @@ -30,6 +30,8 @@ import ( "os" "runtime" "time" + + "github.com/junegunn/fzf/src/util" ) const coordinatorDelayMax time.Duration = 100 * time.Millisecond @@ -59,7 +61,7 @@ func Run(options *Options) { } // Event channel - eventBox := NewEventBox() + eventBox := util.NewEventBox() // Chunk list var chunkList *ChunkList @@ -111,7 +113,7 @@ func Run(options *Options) { looping := true eventBox.Unwatch(EvtReadNew) for looping { - eventBox.Wait(func(events *Events) { + eventBox.Wait(func(events *util.Events) { for evt := range *events { switch evt { case EvtReadFin: @@ -154,7 +156,7 @@ func Run(options *Options) { for { delay := true ticks++ - eventBox.Wait(func(events *Events) { + eventBox.Wait(func(events *util.Events) { defer events.Clear() for evt, value := range *events { switch evt { @@ -185,7 +187,7 @@ func Run(options *Options) { } }) if delay && reading { - dur := DurWithin( + dur := util.DurWithin( time.Duration(ticks)*coordinatorDelayStep, 0, coordinatorDelayMax) time.Sleep(dur) |