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

Fix(vim.vim): Error calling Files when ripgrep is FZF_DEFAULT_COMMAND #1001

Closed
wants to merge 1 commit into from
Closed

Fix(vim.vim): Error calling Files when ripgrep is FZF_DEFAULT_COMMAND #1001

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 28, 2020

related to #657 .

When users set FZF_DEFAULT_COMMAND as rg or rg ~~~, Files command fails. It is because it calls raw fzf which is same as FZF_DEFAULT_COMMAND, but command is supposed to be 'rg --files' to look up files under current directory.

I came up with thinking that I need to fix fzf side, but fzf#vim#grep has same approach replacing FZF_DEFAULT_COMMAND, so I make PR in fzf.vim side.

@junegunn
Copy link
Owner

junegunn commented May 3, 2020

Thanks, but I don't quite see the point of the pull request. It's up to users to use a correct FZF_DEFAULT_COMMAND. We can't fix it for them as they can use different variations of rg command. e.g. rg --files --hidden, rg --files --hidden --follow, etc.

The reason fzf#vim#grep sets FZF_DEFAULT_COMMAND is very different. It is for reload action. See junegunn/fzf#1750 for details.

@junegunn junegunn closed this May 3, 2020
@ghost
Copy link
Author

ghost commented May 3, 2020

@junegunn

Thank you for your reply, but this happens even when user sets FZF_DEFAULT_COMMAND = 'rg' without any options.

It's because ripgrep needs to call 'rg --files' to search files under current directory, however, fzf calls only 'rg' which is just FZF_DEFAULT_COMMAND right now. Therefore I thought it would be useful to call 'rg --files' only when user uses :File.

@junegunn
Copy link
Owner

junegunn commented May 3, 2020

when user sets FZF_DEFAULT_COMMAND = 'rg' without any options.

That's clearly a misconfiguration. The user, not we, should fix it.

@ghost
Copy link
Author

ghost commented May 3, 2020

Ah I totally misunderstood,
I add --files in FZF_DEFAULT_COMMAND and now it works.

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

Successfully merging this pull request may close these issues.

None yet

1 participant