mirror of
https://github.com/junegunn/fzf.git
synced 2026-05-18 06:19:56 +08:00
Add every(N) bind event and FZF_IDLE_TIME env var
- every(N) fires every N seconds (fractional, floored to 0.01s) - Encoded as tui.Every with duration in Char as milliseconds, so every(1) and every(2) coexist as distinct keymap entries - FZF_IDLE_TIME exposes whole seconds since the last user activity (keystroke or mouse event); pair with every() for idle-based patterns like auto-accept/auto-quit Close #1211
This commit is contained in:
@@ -229,6 +229,7 @@ const (
|
||||
ClickHeader
|
||||
ClickFooter
|
||||
Multi
|
||||
Every
|
||||
)
|
||||
|
||||
func (t EventType) AsEvent() Event {
|
||||
@@ -253,6 +254,10 @@ func (e Event) KeyName() string {
|
||||
return me.Name()
|
||||
}
|
||||
|
||||
if e.Type == Every {
|
||||
return "every(" + strconv.FormatFloat(float64(e.Char)/1000, 'f', -1, 64) + ")"
|
||||
}
|
||||
|
||||
if e.Type >= Invalid {
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user