mirror of
https://github.com/junegunn/fzf.git
synced 2025-07-31 04:02:01 -07:00
Add 'focus' event
Can we find a better name? I have considered the followings. * 'point', because "the pointer" points to the current item. * 'shift', 'switch', 'move', etc. These are not technically correct because the current item can change without cursor movement (--tac, reload, search update) * 'change' is already taken. 'change-current' feels a bit wordy and sounds wrong, 'current-changed' is wordy and doesn't go well with the other event names * 'target', not straightforward Close #3053
This commit is contained in:
14
CHANGELOG.md
14
CHANGELOG.md
@@ -3,6 +3,20 @@ CHANGELOG
|
||||
|
||||
0.37.0
|
||||
------
|
||||
- New event
|
||||
- `focus` - Triggered when the focus changes due to a vertical cursor
|
||||
movement or a search result update
|
||||
```sh
|
||||
fzf --bind 'focus:transform-preview-label:echo [ {} ]' --border --preview 'cat {}'
|
||||
|
||||
# Any action bound to the event runs synchronously and thus can make the interface sluggish
|
||||
# e.g. lolcat isn't one of the fastest programs, and every cursor movement in
|
||||
# fzf will be noticeably affected by its execution time
|
||||
fzf --bind 'focus:transform-preview-label:echo [ {} ] | lolcat -f' --border --preview 'cat {}'
|
||||
|
||||
# Beware not to introduce an infinite loop
|
||||
seq 10 | fzf --bind 'focus:up' --cycle
|
||||
```
|
||||
- New actions
|
||||
- `change-border-label`
|
||||
- `change-preview-label`
|
||||
|
Reference in New Issue
Block a user