Skip to content
Myr

Reduce the initial delay when --tac is not given

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

fzf defers the initial rendering of the screen up to 100ms if the input stream is ongoing to prevent unnecessary redraw during the initial phase. However, 100ms delay is quite noticeable and might give the impression that fzf is not snappy enough. This commit reduces the maximum delay down to 20ms when --tac is not specified, in which case the input list quickly fills the entire screen.

authored by Junegunn Choi · committed by Junegunn Choi · parent 9597016 · Browse files · 2 files+11 added−2 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−2 removed

  • other:+11 added−2 removed

2 files+11 added−2 removed

modified:src/constants.go+2 added-1 removed
16 unmodified lines
17 // Reader18 defaultCommand = `find . -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | sed s/^..//`1920 // Terminal21 initialDelay = 100 * time.Millisecond21 initialDelay = 20 * time.Millisecond22 initialDelayTac = 100 * time.Millisecond23 spinnerDuration = 200 * time.Millisecond2425 // Matcher26 progressMinDuration = 200 * time.Millisecond
31 unmodified lines
modified:src/terminal.go+9 added-1 removed
20 unmodified lines
21)2223// Terminal represents terminal input/output24type Terminal struct {25 initDelay time.Duration26 inlineInfo bool27 prompt string28 reverse bool29 hscroll bool
168 unmodified lines
198 } else {199 header = reverseStringArray(opts.Header)200 }201 _tabStop = opts.Tabstop202 var delay time.Duration203 if opts.Tac {204 delay = initialDelayTac205 } else {206 delay = initialDelay207 }208 return &Terminal{209 initDelay: delay,210 inlineInfo: opts.InlineInfo,211 prompt: opts.Prompt,212 reverse: opts.Reverse,213 hscroll: opts.Hscroll,
544 unmodified lines
758 t.printInfo()759 t.printHeader()760 t.mutex.Unlock()761 go func() {754 timer := time.NewTimer(initialDelay)762 timer := time.NewTimer(t.initDelay)763 <-timer.C764 t.reqBox.Set(reqRefresh, nil)765 }()766
408 unmodified lines