summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-04-25 21:30:25 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-04-25 21:30:25 +0900
commitd2c662e54f7d5d011d42915c543c265c0f555d97 (patch)
tree6e3e1acf5f40a5fcdd48f43eb86140ff21564323
parentd24b58ef3fc6d6d2c43e07a44e0f757b9bdfbeff (diff)
downloadfzf-d2c662e54f7d5d011d42915c543c265c0f555d97.tar.gz
Reset coordinator delay on 'reload'
Fix #4364
-rw-r--r--src/core.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core.go b/src/core.go
index 42add205..961d0d37 100644
--- a/src/core.go
+++ b/src/core.go
@@ -295,6 +295,7 @@ func Run(opts *Options) (int, error) {
// Event coordination
reading := true
ticks := 0
+ startTick := 0
var nextCommand *commandSpec
var nextEnviron []string
eventBox.Watch(EvtReadNew)
@@ -321,6 +322,7 @@ func Run(opts *Options) (int, error) {
clearDenylist()
}
reading = true
+ startTick = ticks
chunkList.Clear()
itemIndex = 0
inputRevision.bumpMajor()
@@ -509,7 +511,7 @@ func Run(opts *Options) (int, error) {
}
if delay && reading {
dur := util.DurWithin(
- time.Duration(ticks)*coordinatorDelayStep,
+ time.Duration(ticks-startTick)*coordinatorDelayStep,
0, coordinatorDelayMax)
time.Sleep(dur)
}