-
Notifications
You must be signed in to change notification settings - Fork 22
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
Improve back-slash handling to reduce confusion #41
Comments
You should be confused because it is confusing. There are multiple levels of escaping happening here, I think:
I think the shell in particular makes this tricky to understand, as evidenced by this Stack Exchange post. |
@wincent Thanks. Now I understand what happened. The other question is, won't it be more readable for the inputed regular expression if Ferret do the extra escaping ? |
That's an interesting idea. If it could be done reliably, that would be great. Having to be aware of the complicated escaping rules definitely makes the current set-up a leaky abstraction. The only "gotcha" I can think of here is that depending on which mode Ferret is running in (using modern vim "async" primitives, using the vim-dispatch plug-in, or falling back to the legacy code path), the exact method used to launch the underlying tool may vary, so the escaping requirements may be different. We'd want to look into that to be sure that all the cases are correctly handled. |
@wincent Yeah, I'm looking forward to that. |
I think I have this working fairly nicely now on the "next" branch. Have tested with async Neovim, async Vim 8, and vanilla (non-async) Vim-8. Haven't bothered to test with vim-dispatch, yet, but I will. If I haven't run into any issues with this in a few days, will merge to master. |
Currently, I use ferret with rg to search for patterns. If the pattern is complicated, it is likely that it's not compatible with I think it would be better if there is an option with which I can hook a customized function to escape characters when |
Either
:Ack App\\\Link
or:Ack App\\\\Link
will findApp\Link
.Why ? Won't it be easier to be understood with
:Ack App\\Link
?The text was updated successfully, but these errors were encountered: