Add every(N) bind event and FZF_IDLE_TIME env var (#4797)

- 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-17 23:54:59 +09:00
committed by GitHub
parent e0d081906f
commit fcc3c6acce
8 changed files with 248 additions and 26 deletions
+10 -6
View File
@@ -196,11 +196,6 @@ const (
CtrlAltShiftPageUp
CtrlAltShiftPageDown
Invalid
Fatal
BracketedPasteBegin
BracketedPasteEnd
Mouse
DoubleClick
LeftClick
@@ -214,7 +209,15 @@ const (
PreviewScrollUp
PreviewScrollDown
// Events
// Synthetic / non-user events. Everything from Invalid onward is
// either internally generated or a state-change notification, not
// direct user input. Use `>= Invalid` to gate activity tracking.
// BracketedPasteBegin/End sit here too: they enclose user input
// (which arrives as Rune events) and should not appear in FZF_KEY.
Invalid
Fatal
BracketedPasteBegin
BracketedPasteEnd
Resize
Change
BackwardEOF
@@ -229,6 +232,7 @@ const (
ClickHeader
ClickFooter
Multi
Every
)
func (t EventType) AsEvent() Event {