Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing multi-select choices to :preview-fn #3

Open
sheluchin opened this issue Feb 20, 2025 · 0 comments
Open

Passing multi-select choices to :preview-fn #3

sheluchin opened this issue Feb 20, 2025 · 0 comments

Comments

@sheluchin
Copy link

Thanks for this handy library. I'm just wondering if you might have some idea of how we could modify the code to allow all of the selected choices to be passed to the preview-fn. At the moment, it only passes the current item.

In fzf, there is the {+} placeholder which is produced a space-separated list of the selected lines (see junegunn/fzf#3574 (reply in thread)). I attempted to get this working locally but couldn't quite figure out how to handle it with the embedded preview server/bbnc namespace.

You can achieve a similar effect using something like:

  (fzf {:preview "echo {+} | bb -e  '(->> (str/split (slurp *in*) #\" \") (map (comp parse-long str/trim)) (apply +))'"
        :multi true}
       [1 2 3]))

but it would be a bit nicer if we could receive the selections as a vector in preview-fn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant