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 -p xxx.lua return 1 if there is any errors which cause plugin throw a excpetion. #3

Closed guotsuan closed 11 years ago

guotsuan commented 12 years ago

Hi,

In my system lua (version 5.1), if there is any errors in the file. the command "luac -p xxx.lua# exit with code 1. it will cause the plugin throw an exception and stop the plugin

in os.vim

"try "Try using my shell.vim plug-in. "return call('xolox#shell#execute', [a:cmdline, 1] + a:000) "catch /^Vim\%((\a+))\=:E117/ "Fall back to system() when we get an "unknown function" error. let output = call('system', [a:cmdline] + a:000) "if v:shell_error "throw printf("os.vim %s: Command %s failed: %s", g:xolox#misc#os#vers ion, a:cmdline, xolox#misc#str#trim(output)) "endif return split(output, "\n") "endtry

I have to comment the catch setences to let the plugin continue to run.

Thank you

xolox commented 11 years ago

This should now be fixed. Thanks for the feedback! If it still doesn't work for you, feel free to reopen this issue.