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 passing arguments with spaces to external commands #217

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

eira-fransham
Copy link

@eira-fransham eira-fransham commented Aug 27, 2019

Surrounds the parameter passed to the -c/--command external executable with '..' and escapes the string appropriately. This means that when doing interactive grep using ripgrep you can type pub fn my_function_name - a very commonly-needed query - and get the correct result.

I assume this wasn't previously done for performance reason, so PR uses my lazy string replacement crate to avoid intermediate allocations. The speed should be pretty good despite escaping, surrounding with quotes and then replacing the {} (or other -I string) in the command parameter since that's all done in one pass.

From testing on my own computer the speed is very good, but that's just anecdotal evidence.

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

Successfully merging this pull request may close these issues.

1 participant