Trigger focus event after reload (#4931)
CodeQL / Analyze (go) (push) Canceled after 0s
build / build (push) Canceled after 0s
Test fzf on macOS / build (push) Canceled after 0s

- Indexes restart after reload, so same-index item was not seen as new
- With --id-nth, compare by key. No event if focused item keeps its key.
- Skip focus check while track is blocked
- Document that binding reload to focus can loop

Close #4930
This commit is contained in:
Junegunn Choi authored and GitHub committed 2026-10-10 20:59:13 +09:00
1 parent 33a3456921
commit 25adb67453
4 files changed
+95 -8

No files matched your search

+4 -1
View File
@@ -1909,7 +1909,10 @@ e.g.
\fIfocus\fR
.RS
Triggered when the focus changes due to a vertical cursor movement or a search
result update.
result update. After a reload, the focused item is considered new unless
\fB\-\-id\-nth\fR is set and the item has the same key as the previously
focused item. Because of this, binding \fBreload\fR to this event can cause an
infinite loop.
e.g.
\fBfzf \-\-bind 'focus:transform\-preview\-label:echo [ {} ]' \-\-preview 'cat {}'