forked from neovim/neovim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(:source, nvim_exec): SID without allocated item
Always assign unique SID for anonymous sources, but defer allocation of script items and vars until script var access. Because all anonymous scripts always have SIDs now, <SID> and s: scope (also defined in functions, autocmds, commands, etc.) will work. Because a SID may not yet (or ever) map to an item, use a hash map for script_items and ga_scripts (now script_vars). Add file_sids; a sorted growarray of SIDs associated with a script file (used for :scriptnames, profiling, do_source, etc.). Replace SCRIPT macros with script_item and script_sv functions. Remove SCRIPT_VARS as it isn't very useful now. Use PRIdSCID to format scid_T in some places that were missing it. This also fixes an issue since neovim#15079 that resulted in duplicate file name entries in :scriptnames output; test for this. Adjust more tests to use anonymous :source. Note that as prior s: or <SID> access is no longer needed for scripts to be given a SID, <SNR>s in tests that already use anonymous :sources such as echo_spec.lua need to be adjusted. Also note that we can potentially support adding profiling support for anonymous scripts now. :)
- Loading branch information
Showing
14 changed files
with
221 additions
and
234 deletions.
There are no files selected for viewing
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
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
Oops, something went wrong.