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