Debian Codegraph @

src/constants.go

raw
1 package fzf
2
3 import (
4 "math"
5 "time"
6
7 "github.com/junegunn/fzf/src/util"
8 )
9
10 const (
11 // Core
12 coordinatorDelayMax time.Duration = 100 * time.Millisecond
13 coordinatorDelayStep time.Duration = 10 * time.Millisecond
14
15 // Reader
16 readerBufferSize = 64 * 1024
17 readerSlabSize = 128 * 1024
18 readerPollIntervalMin = 10 * time.Millisecond
19 readerPollIntervalStep = 5 * time.Millisecond
20 readerPollIntervalMax = 50 * time.Millisecond
21
22 // Terminal
23 initialDelay = 20 * time.Millisecond
24 initialDelayTac = 100 * time.Millisecond
25 spinnerDuration = 100 * time.Millisecond
26 previewCancelWait = 500 * time.Millisecond
27 previewChunkDelay = 100 * time.Millisecond
28 previewDelayed = 500 * time.Millisecond
29 maxPatternLength = 1000
30 maxMulti = math.MaxInt32
31
32 // Background processes
33 maxBgProcesses = 30
34 maxBgProcessesPerAction = 3
35
36 // Matcher
37 progressMinDuration = 200 * time.Millisecond
38
39 // Capacity of each chunk
40 chunkSize int = 1024
41 chunkBitWords = (chunkSize + 63) / 64
42
43 // Pre-allocated memory slices to minimize GC
44 slab16Size int = 100 * 1024 // 200KB * 32 = 12.8MB
45 slab32Size int = 2048 // 8KB * 32 = 256KB
46
47 // Do not cache results of low selectivity queries
48 queryCacheMax int = chunkSize / 2
49
50 // Not to cache mergers with large lists
51 mergerCacheMax int = 100000
52
53 // History
54 defaultHistoryMax int = 1000
55
56 // Jump labels
57 defaultJumpLabels string = "asdfghjklqwertyuiopzxcvbnm1234567890ASDFGHJKLQWERTYUIOPZXCVBNM`~;:,<.>/?'\"!@#$%^&*()[{]}-_=+"
58 )
59
60 // fzf events
61 const (
62 EvtReadNew util.EventType = iota
63 EvtReadFin
64 EvtSearchNew
65 EvtSearchProgress
66 EvtSearchFin
67 EvtReady
68 EvtQuit
69 )
70
71 const (
72 ExitOk = 0
73 ExitNoMatch = 1
74 ExitError = 2
75 ExitBecome = 126
76 ExitInterrupt = 130
77 )