Skip to content

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


let s:lua_path_cache = ['', []]
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.

2 participants