junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
63.72k stars 2.37k forks source link

Match highlighting in filter mode #1643

Open iamlemec opened 5 years ago

iamlemec commented 5 years ago

I'm looking into incorporating match highlighting in filter mode. I have a very rough prototype in a fork over at iamlemec/fzf. Basically, I have two questions:

  1. Is this something that there is interest in and you'd be willing to accept in the main repo? It seems to me this would help people looking to integrate fzf into other tools. My own use case is what amounts to a web interface to fzf: source at iamlemec/fuzzy and demo at dohan.io/fuzzy.

  2. Supposing the answer to the above is yes or maybe, what's the best way to integrate this? Right now, I've got some code duplication because CSI code generation is integrated into the terminal renderer itself. I'm guessing this is done partially for performance reasons, so I'm a little hesitant to mess with that.

Anyway, thanks for writing fzf!

aeriksson commented 4 years ago

Just wanted to add that this would be really helpful for my use-case as well, which involves piping a bunch of data to FZF and parsing the results. As it stands, I have to redundantly parse the query string and figure out where in FZF's the highlights should go — It'd be much nicer if I could parse the highlights directly from the output.

NightMachinery commented 3 years ago

I want this to highlight the preview pane. Since fzf uses its own syntax, it's really hard to highlight the preview intelligently using normal tools which work with regexes.