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

escape special chars in <cword> when run :Ack<CR> #234

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

Conversation

FuDesign2008
Copy link

In javascript / php, $ is valid in a variable.

function $sayHello () {}

If we run :Ack<CR> when cursor is under $sayHello, nothing will be found.

So try to escape $ and wrap <cword> in ' .

@benknoble
Copy link

benknoble commented May 30, 2019

I wonder if shellescape or fnameescape might help?

@FuDesign2008
Copy link
Author

  1. This commit is only fix for the word that includes $, is not a universal solution.
  2. The source file has following comment. I'm not familiar with vimscript and can't find a better solution.
  " NOTE: we escape special chars, but not everything using shellescape to
  "       allow for passing arguments etc

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.

None yet

2 participants