Skip to content
Myr

constants.go

This file

Path

src/constants.go

84 lines · 2.1 KiB · Go

Last changed by

Merge branch 'devel' into masterJunegunn Choibefore adoption51dfacd

History of this file

Take it

1package fzf23import (4	"math"5	"os"6	"time"78	"github.com/junegunn/fzf/src/util"9)1011const (12	// Core13	coordinatorDelayMax  time.Duration = 100 * time.Millisecond14	coordinatorDelayStep time.Duration = 10 * time.Millisecond1516	// Reader17	readerBufferSize       = 64 * 102418	readerPollIntervalMin  = 10 * time.Millisecond19	readerPollIntervalStep = 5 * time.Millisecond20	readerPollIntervalMax  = 50 * time.Millisecond2122	// Terminal23	initialDelay      = 20 * time.Millisecond24	initialDelayTac   = 100 * time.Millisecond25	spinnerDuration   = 100 * time.Millisecond26	previewCancelWait = 500 * time.Millisecond27	previewChunkDelay = 100 * time.Millisecond28	previewDelayed    = 500 * time.Millisecond29	maxPatternLength  = 30030	maxMulti          = math.MaxInt323132	// Matcher33	numPartitionsMultiplier = 834	maxPartitions           = 3235	progressMinDuration     = 200 * time.Millisecond3637	// Capacity of each chunk38	chunkSize int = 1003940	// Pre-allocated memory slices to minimize GC41	slab16Size int = 100 * 1024 // 200KB * 32 = 12.8MB42	slab32Size int = 2048       // 8KB * 32 = 256KB4344	// Do not cache results of low selectivity queries45	queryCacheMax int = chunkSize / 54647	// Not to cache mergers with large lists48	mergerCacheMax int = 1000004950	// History51	defaultHistoryMax int = 10005253	// Jump labels54	defaultJumpLabels string = "asdfghjklqwertyuiopzxcvbnm1234567890ASDFGHJKLQWERTYUIOPZXCVBNM`~;:,<.>/?'\"!@#$%^&*()[{]}-_=+"55)5657var defaultCommand string5859func init() {60	if !util.IsWindows() {61		defaultCommand = `set -o pipefail; command find -L . -mindepth 1 \( -path '*/\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \) -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-`62	} else if os.Getenv("TERM") == "cygwin" {63		defaultCommand = `sh -c "command find -L . -mindepth 1 -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-"`64	}65}6667// fzf events68const (69	EvtReadNew util.EventType = iota70	EvtReadFin71	EvtSearchNew72	EvtSearchProgress73	EvtSearchFin74	EvtHeader75	EvtReady76)7778const (79	exitCancel    = -180	exitOk        = 081	exitNoMatch   = 182	exitError     = 283	exitInterrupt = 13084)