kelleyma49 / PSFzf

A PowerShell wrapper around the fuzzy finder fzf
MIT License
795 stars 36 forks source link

Does this wrapper support fuzzy selecting object, rather then just string? #29

Open onriv opened 4 years ago

onriv commented 4 years ago

There are cases, for example:

ls|%{$_.Name}|fzf|%{ls -Filter $_}

rather than select the string and search with the target object with it, does this wrapper support fuzzily selecting object?

kelleyma49 commented 4 years ago

Good question. PsFzf doesn't currently support this. I've been thinking of how to do this, and there isn't a straightforward way to support this.

As PSFzf is a wrapper around fzf. Fzf only deals with strings. The id of the object would have to be passed into fzf so it could be passed out in the results. PSFzf would have to store the objects until fzf returns so it can match the object to the value returned by fzf.

mattcargile commented 2 years ago

I haven't read through it all. I think the below code might be helpful here. I want to explore it some time.

https://github.com/ninmonkey/Ninmonkey.Console/blob/5b89dea91a8cff988a807f7799d261884cf19b46/public/Select-NinProperty.ps1