xolox / vim-lua-ftplugin

Lua file type plug-in for the Vim text editor
http://peterodding.com/code/vim/lua-ftplugin
187 stars 27 forks source link

luac has problems with shellescape #1

Closed ubunatic closed 12 years ago

ubunatic commented 12 years ago

I debugged the lua.vim script and found a problem on windows (7): I reproduced it manually on the command line:

C:\somedir> luac -p 'C:/home/juve/workspace/test/main.lua'

produces an error:

luac: cannot open 'C:/home/juve/workspace/test/main.lua': Invalid argument

Using default double quotes works fine.

C:\somedir> luac -p "C:/home/juve/workspace/test/main.lua"

The problem derives from vim's shellescape (I guess):

function xolox#lua#checksyntax
line 18: execute 'silent make!' compiler_args shellescape(expand('%'))

The status line in Vim shows:

lua.vim 0.6.27: Syntax error on line 0: luac: cannot open 'C:/home/juve/workspace/test/main.lua': Invalid argument
ubunatic commented 12 years ago

OK, found the problem. I did set shellslash. :set noshellslash in .vimrc solved the problem.

xolox commented 12 years ago

Hi Uwe,

I've had so many bug reports about the shellslash option breaking the shellescape() function that I now consider it a bug when my Vim plug-ins don't work around this issue :-). Anyway, I've just released version 0.6.28 of the Lua file type plug-in which should work regardless of the shellslash setting. Thanks for the feedback!