mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-15 20:23:50 -07:00
Adjust initial coordinator delay
This commit is contained in:
10
src/core.go
10
src/core.go
@@ -7,7 +7,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const COORDINATOR_DELAY time.Duration = 100 * time.Millisecond
|
||||
const COORDINATOR_DELAY_MAX time.Duration = 100 * time.Millisecond
|
||||
const COORDINATOR_DELAY_STEP time.Duration = 10 * time.Millisecond
|
||||
|
||||
func initProcs() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
@@ -151,8 +152,11 @@ func Run(options *Options) {
|
||||
}
|
||||
}
|
||||
})
|
||||
if ticks > 3 && delay && reading {
|
||||
time.Sleep(COORDINATOR_DELAY)
|
||||
if delay && reading {
|
||||
dur := DurWithin(
|
||||
time.Duration(ticks)*COORDINATOR_DELAY_STEP,
|
||||
0, COORDINATOR_DELAY_MAX)
|
||||
time.Sleep(dur)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user