Error in function query_path when opening ruby file #143

Closed
robi-wan opened this Issue Mar 19, 2013 · 1 comment

Projects

None yet

3 participants

@robi-wan

I am running vim 7.3.829 on Windows 7 64bit.

When opening a ruby file an error is displayed in vim:

vim_ruby_error

The important message says:

"'" kann syntaktisch an dieser Stelle nicht verarbeitet werden

which means

"'" can not be processed at this point syntactically

Executing

:echo system("ruby -e 'print $:.join(%q{,})'")

as mentionend in #77 gets the same error:

"'" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
E484: Can't open file C:\Users\ntrs\AppData\Local\Temp\VIoFFA8.tmp

Reading this http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx reminded me that

parentheses ( ) are special characters that must be preceded by the escape character (^) or quotation marks when you pass them as arguments.

When I change the command to

:echo system("ruby -e 'print $:.join^(%q{,}^)'")

(note that I escaped the parentheses ( ) with ^ ) it displays the expected result.

In vim-fugitive happens something similar:
https://github.com/tpope/vim-fugitive/blob/f6d93b8788b57990a2669b2408004c0086d6a878/plugin/fugitive.vim#L2010-2012

Another way of getting this command execute on windows is switching the single and double quotation marks:

:echo system('ruby -e "print $:.join(%q{,})"')

Note that the single quotation marks are at the outside and the double quotation marks are at the inner side of the command.

My shellxquote variable defaults to (.

Or get rid of the parentheses around the join arguments:

:echo system("ruby -e 'print $:.join %q{,}'")

This also works.

@tpope tpope added a commit that closed this issue Mar 19, 2013
@tpope tpope Fix Windows shell escaping issue
Closes #143.
3ead93f
@tpope tpope closed this in 3ead93f Mar 19, 2013
@tpope
Member
tpope commented Mar 19, 2013

Great analysis. I've dropped the parentheses. I've battled with Windows escaping enough that I'd rather sidestep it entirely whenever possible.

@airblade airblade referenced this issue in airblade/vim-gitgutter Mar 19, 2013
Closed

Kind of "freeze" on Windows 7 #44

@dkearns dkearns added the ftplugin label Sep 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment