mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-09-28 21:29:03 +00:00
8695b5e319
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.
58 lines
1.0 KiB
Go
58 lines
1.0 KiB
Go
package fzf
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/junegunn/fzf/src/util"
|
|
)
|
|
|
|
const (
|
|
// Current version
|
|
version = "0.11.2"
|
|
|
|
// Core
|
|
coordinatorDelayMax time.Duration = 100 * time.Millisecond
|
|
coordinatorDelayStep time.Duration = 10 * time.Millisecond
|
|
|
|
// Reader
|
|
defaultCommand = `find . -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | sed s/^..//`
|
|
|
|
// Terminal
|
|
initialDelay = 20 * time.Millisecond
|
|
initialDelayTac = 100 * time.Millisecond
|
|
spinnerDuration = 200 * time.Millisecond
|
|
|
|
// Matcher
|
|
progressMinDuration = 200 * time.Millisecond
|
|
|
|
// Capacity of each chunk
|
|
chunkSize int = 100
|
|
|
|
// Do not cache results of low selectivity queries
|
|
queryCacheMax int = chunkSize / 5
|
|
|
|
// Not to cache mergers with large lists
|
|
mergerCacheMax int = 100000
|
|
|
|
// History
|
|
defaultHistoryMax int = 1000
|
|
)
|
|
|
|
// fzf events
|
|
const (
|
|
EvtReadNew util.EventType = iota
|
|
EvtReadFin
|
|
EvtSearchNew
|
|
EvtSearchProgress
|
|
EvtSearchFin
|
|
EvtHeader
|
|
EvtClose
|
|
)
|
|
|
|
const (
|
|
exitOk = 0
|
|
exitNoMatch = 1
|
|
exitError = 2
|
|
exitInterrupt = 130
|
|
)
|