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:
Junegunn Choi
2026-05-16 14:31:46 +09:00
parent e0d081906f
commit 38c88e4753
8 changed files with 208 additions and 3 deletions
+5
View File
@@ -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 ""
}