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

Do not throw when luac returns an error code. #8

Closed vinsonchuong closed 11 years ago

vinsonchuong commented 11 years ago

In luac 5.1, code errors cause an error code to be returned. So, "syntax error" error codes and "undefined global variable" error codes need to be allowed through. I wasn't able to find a list of luac error codes; so, I chose to remove the "if v:shell_error" guard completely.

This fixes Issue #3

xolox commented 11 years ago

Thanks for the feedback, I agree this should be improved. Unfortunately the fix is not quite as simple as your pull request makes it appear.

Note to myself and anyone reading along: I'd like to fix this but there's quite a bit of work involved. I'll have to adapt the interfaces of the following functions and check all call sites for each of these functions:

I'll definitely implement this because it's been bothering me for quite a while that I can't reliably check return codes, but it might be a while until I have something that works well enough to publish.

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 pull request or create a new issue.