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
Fix #30 – user plugins take priority over built-in plugins #73
Conversation
GitHub didn't pick up on the title, but this closes #30 Edit: This needs to be in the main message, so ignore this comment. |
Thank you, this is nicely done. I just made a couple of comments, please clarify. Otherwise I am not sure how the github's "review" thing works. |
@franko You could look over Github's own documentation on the subject :) |
Thank you @liquidev |
Hey @liquidev I think we have been too hasty with this patch, it just does not work! I get this:
I think the problem is that you are using the file information but the value can be nil. By looking more closely I didn't have time to give a solution but it seems that the logic should be tightened. May be you can go back to the original implementation and only apply minimal modifications by strictly verifying that each modification is sound. I advice to not use common.basename and stick to the old implementation, just make the modification to ensure the files ends with the ".lua" extension. |
@franko I'll work on that tomorrow, I turned my computer off for the night already. In the meantime, could you revert the changes I made? |
Don't worry, there is no need to revert, nothing bad will happen, you can fix this later when you want. |
I don't know how ugly this solution is, considering that it messes with the package search path. In my opinion the plugin system should be changed not to use
require
though, and usedofile()
together with setting keys inpackage.loaded
orpackage.preload
, so that it's not prone to cases like this. On the other hand, some plugins like my own lint+ are composed of multiple modules, so having the package search path contain the user configuration directory is quite useful. I'm just not sure about this change, which involves changing the order of package search paths inpackage.path
.Closes #30