mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-12 08:26:27 +00:00
Minor refactoring
This commit is contained in:
parent
deccdb1ec5
commit
a5ad8fd3bd
@ -20,6 +20,7 @@ const (
|
|||||||
defaultWidth = 80
|
defaultWidth = 80
|
||||||
defaultHeight = 24
|
defaultHeight = 24
|
||||||
|
|
||||||
|
defaultEscDelay = 100
|
||||||
escPollInterval = 5
|
escPollInterval = 5
|
||||||
offsetPollTries = 10
|
offsetPollTries = 10
|
||||||
)
|
)
|
||||||
@ -164,15 +165,7 @@ func atoi(s string, defaultValue int) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *LightRenderer) Init() {
|
func (r *LightRenderer) Init() {
|
||||||
delay := 100
|
r.escDelay = atoi(os.Getenv("ESCDELAY"), defaultEscDelay)
|
||||||
delayEnv := os.Getenv("ESCDELAY")
|
|
||||||
if len(delayEnv) > 0 {
|
|
||||||
num, err := strconv.Atoi(delayEnv)
|
|
||||||
if err == nil && num >= 0 {
|
|
||||||
delay = num
|
|
||||||
}
|
|
||||||
}
|
|
||||||
r.escDelay = delay
|
|
||||||
|
|
||||||
fd := r.fd()
|
fd := r.fd()
|
||||||
origState, err := terminal.GetState(fd)
|
origState, err := terminal.GetState(fd)
|
||||||
|
Loading…
Reference in New Issue
Block a user