-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
refactor(lua): call loadfile
internally instead of luaL_loadfile
#17200
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before I work on this any more, @bfredl are you OK with the premise of this PR? |
@lewis6991 yes. |
lewis6991
changed the title
feat(lua): add vim._loadfile
refactor(lua): call loadfile internally
Feb 2, 2022
lewis6991
changed the title
refactor(lua): call loadfile internally
refactor(lua): call Feb 2, 2022
loadfile
internally instead of luaL_loadfile
3 tasks
Needs an update to tests:
I haven't checked the test in detail but likely just putting in the new message should be fine. |
bfredl
reviewed
Feb 17, 2022
lewis6991
force-pushed
the
_loadfile
branch
2 times, most recently
from
February 18, 2022 00:16
11d2ed6
to
7f44d62
Compare
bfredl
reviewed
Feb 18, 2022
.. instead of luaL_loadfile allows files to be cached
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A version of loadfile with the intention of being redefined to allow third-party plugins to provide instrumentation and caching.This will allow impatient.nvim to cache Lua files in directories like
plugin
andafter
.loadfile
is still called via C so the only additional overhead is via the Lua-C API which shouldn't be too bad.Obviously this will need some discussion (hence this is a draft), but I hope we agree on the overall goal.
EDIT: Changed so the Lua built-in
loadfile
is called instead of the direct C versionluaL_loadfile
.