bling / fzf.el

A front-end for fzf
GNU General Public License v3.0
360 stars 50 forks source link

dwim operations with grep -rnH do not work #95

Closed pierre-rouleau closed 1 year ago

pierre-rouleau commented 1 year ago

I wonder if something broke recently or if that ever worked, but when one of the fzf-grep-dwim or fzf-grep-dwim-with-narrowing is used while fzf/grep-command uses grep (as opposed to rg) the operation does not work.

The reason it does not work is the grep command requires a file pattern to search otherwise it searches from its stdin. The 'dwim' commands provide a pattern that the command can append to fzf/grep-command but grep does not see any file pattern. So the grep operation fails. If we change fzf/grep-command to use rg (ripgrep) then it works because ripgrep recusively searches all files (except the hidden ones) by default.

So... I wonder... Did these dwim commands ever worked with 'grep -rnH' , or did I break something?

@bling, do you know?

pierre-rouleau commented 1 year ago

@bling I pushed a potential work-around fix for that, at least allowing the dwim operations to work. It could probably be improved but it's better than nothing. See https://github.com/bling/fzf.el/pull/96/commits/96be3973d5901810b5549f764076eea376668686

pierre-rouleau commented 1 year ago

The latest pushed code fixes the issue