Skip to content
Discussion options

You must be logged in to vote
local cursor_index = items_get_cursor(items)
fzf_set_cursor(cursor_index)

This part is not trivial. We can get absolute index from the origin list (e.g. with actions.xx.field_index="{+n}"). But pos() only accept index for current "filtered" list (e.g. something like $FZF_POS).

Another approach is --listen, you can inspect by:

seq 1000 | fzf --listen --preview 'curl -sL localhost:$FZF_PORT | jq'

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 …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@aidancz
Comment options

@nenahp
Comment options

Answer selected by aidancz
@aidancz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants