2015-01-02 04:49:30 +09:00
|
|
|
package fzf
|
|
|
|
|
2015-01-12 12:56:17 +09:00
|
|
|
import (
|
2015-04-17 22:23:52 +09:00
|
|
|
"time"
|
|
|
|
|
2015-01-12 12:56:17 +09:00
|
|
|
"github.com/junegunn/fzf/src/util"
|
|
|
|
)
|
|
|
|
|
2015-04-17 22:23:52 +09:00
|
|
|
const (
|
|
|
|
// Current version
|
2015-09-12 12:50:32 +09:00
|
|
|
version = "0.10.5"
|
2015-04-17 22:23:52 +09:00
|
|
|
|
|
|
|
// Core
|
|
|
|
coordinatorDelayMax time.Duration = 100 * time.Millisecond
|
|
|
|
coordinatorDelayStep time.Duration = 10 * time.Millisecond
|
|
|
|
|
|
|
|
// Reader
|
2015-08-01 21:48:35 +09:00
|
|
|
defaultCommand = `find . -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | sed s/^..//`
|
2015-04-17 22:23:52 +09:00
|
|
|
|
|
|
|
// Terminal
|
|
|
|
initialDelay = 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
|
2015-06-14 00:43:44 +09:00
|
|
|
|
|
|
|
// History
|
|
|
|
defaultHistoryMax int = 1000
|
2015-04-17 22:23:52 +09:00
|
|
|
)
|
2015-01-02 04:49:30 +09:00
|
|
|
|
2015-01-12 03:01:24 +09:00
|
|
|
// fzf events
|
2015-01-02 04:49:30 +09:00
|
|
|
const (
|
2015-01-12 12:56:17 +09:00
|
|
|
EvtReadNew util.EventType = iota
|
2015-01-12 03:01:24 +09:00
|
|
|
EvtReadFin
|
|
|
|
EvtSearchNew
|
|
|
|
EvtSearchProgress
|
|
|
|
EvtSearchFin
|
2015-07-22 03:21:20 +09:00
|
|
|
EvtHeader
|
2015-01-12 03:01:24 +09:00
|
|
|
EvtClose
|
2015-01-02 04:49:30 +09:00
|
|
|
)
|
2015-09-15 13:21:51 +09:00
|
|
|
|
|
|
|
const (
|
|
|
|
exitOk = 0
|
|
|
|
exitNoMatch = 1
|
|
|
|
exitError = 2
|
|
|
|
)
|