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

Re-add support for g:lua_path #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Nov 20, 2014

Commit 6d68f3d removed the functionality to define/override $LUA_PATH,
but the documentation still mentions it.

This also adds support for caching in xolox#lua#getsearchpath, which
appears to be useful anyway.

I could also imagine a way to support extending the path (prepending and/or appending to it).

My use case is the awesome window manager, which adjusts its path internally, and changes are not reflected in $LUA_PATH or the lua interpreter.

Copy link

@idbrii idbrii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Causes errors for users who don't set g:lua_path

function! xolox#lua#getsearchpath(envvar, luavar) " {{{1
if exists('s:lua_path_cache') && s:lua_path_cache[0] == g:lua_path
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unchecked use of g:lua_path here causes E121: Undefined variable: g:lua_path for me.

Is this exists check testing the wrong thing? s:lua_path_cache will always exist since it's defined above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testing the wrong thing?

Seems so, amended.

Commit 6d68f3d removed the functionality to define/override $LUA_PATH,
but the documentation still mentions it.

This also adds support for caching in xolox#lua#getsearchpath, which
appears to be useful anyway.
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