-
I’m writing a custom provider and would like it to have this action:
the fzf_get_matched_items function returns a list of string the fzf_set_cursor function is similar to FZF’s built-in pos() action This way, as soon as FZF starts or the query changes, the selected entry in FZF will be exactly what I want is it possible? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Maybe this is what you want?
EDIT: I seems seeing what you mean. This don't work... |
Beta Was this translation helpful? Give feedback.
-
I think this is what you want: To always use the first:
EDIT: need |
Beta Was this translation helpful? Give feedback.
This part is not trivial. We can get absolute index from the origin list (e.g. with
actions.xx.field_index="{+n}"
). Butpos()
only accept index for current "filtered" list (e.g. something like$FZF_POS
).Another approach is
--listen
, you can inspect by:But you cannot find a value in the json can be directly used by
pos()
. From the action implementation...https://github.com/junegunn/fzf/blob/4811e52af3ed7f89e82baa908f9a8a25fb593361/src/terminal.go#L6598-L6609
The implementation above iterate all the list to find a pos. So I would guess what you …