ktr0731 / go-fuzzyfinder

fzf-like fuzzy-finder as a Go library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: find from a channel of entries

stephane-martin opened this issue · comments

Hello,

First, thank you for this great library.

it is possible to feed fzf's stdin with the output of a running command. The possible choices then appear progressively to the user.

Similarly, I'd like to have a Find() function that takes a channel of entries instead of a slice.

Is that difficult to implement ?

commented

Hi. Thank you for submitting the issue.
I think it is not difficult to implement the feature, but I don't know use-cases what the feature is used.
Could you show me some use-cases?

Well, making a list of choices can take a lot of time (think 'find /'). While the list is being built, the UI is not reactive and the user is blocked. It would be better to show the first choices as they are being produces. Try 'cd /; fzf' to see what i mean...

commented

I understand. Just as you said, it is a good feature for user experience.
I'll try to implement it. Thank you.

hi @ktr0731 thanks for this library! Do you have any in progress work on this? Alternatively, do you have any suggestions in dealing with large lists?

commented

Hi. I've implemented a prototype in my machine and I uploaded it.
Please see #7 if you are interested in it.
But I still need to improve code (add some tests, improve code quality, and so on) so it takes a more little time.

thanks @ktr0731 i will try this out.

commented

The feature has been implemented in #7
See _example/hotreload/main.go for an example.