-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
--files flag tries to interpret some arguments as regexes #326
Comments
Thanks for reporting this! I'll be honest, I have no idea what you're talking about or how to reproduce the problem. ripgrep should have no problems with Windows paths on Windows. Could you please try to reproduce the issue outside of ctrlp/vim? Also, could you please include other basic information like your ripgrep version and environment? E.g., cygwin or native Windows? |
Of course I tried in the command line. In fact that's how I found out / worked around the problem. |
It sounds like you're trying to type a file path for your regex? Could you please provide more details about your environment? Are you in cygwin? A native console? I've certainly used paths like |
This is a normal windows console, yes. |
I can't reproduce this problem on ripgrep 0.4.0. I can run Can you please provide additional information? |
Please note that I also used the '--files' flag, so ripgrep should interpret the rest as a path, isn't that right? |
@chopsueysensei I'm trying to figure out the cause of the bug you're reporting. Sometimes the cause of bugs is that the report is either flawed in some way or I've misunderstood it (i.e., "user error" bugs). I'm trying to rule out that possibility. I will be very clear. This is expected and correct output, because
But this is unexpected and incorrect output because
However, I cannot reproduce this problem. Given the relative simplicity of the invocation, this led me to try to rule out user error. I don't have any idea as to what's actually wrong yet. This bug doesn't make any sense to me. |
Interesting. While I couldn't reproduce this on Windows, I can seem to reproduce it on Linux:
Weird. I should be able to track down the cause of the problem now. |
I understand your motivations, of course. But, as I noted, I was using the '--files' switch so indeed it seems as if it still wanted to interpret what should be a path as a regex instead. |
A slight workaround if you do want it to work in ctrl-p
This will have a stray |
Another workaround is to add the -F flag so it treats patterns as literal strings instead of as regex. So for ctrl-p on windows I use
|
@dfbrown Clever hack! This bug should be fixed in the next release. :-) |
Hi.
When trying to integrate your wonderful tool inside vim using 'let g:ctrlp_user_command = ...' I always got an error back because it seems that CtrlP always sends the path in windows format, which rg doesn't like, because apparently it tries to interpret the path as a regex (I checked this on the command line).
Strangely enough, even when setting 'shellslash' to on, the behaviour doesn't change (I'm gonna open an issue with CtrlP about this), so I had to resort to a custom batch script that substitutes the backslashes with forward slashes. Hacky to say the least.. :P
I think backslash support in Windows should be improved. I'm surprised nobody had problems with this before.. I don't know what the best approach would be, though. Maybe a specific switch or marker char that would mean "use this verbatim" or something?
The text was updated successfully, but these errors were encountered: