mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
vim-patch:8.2.0114: info about sourced scripts is scattered
Problem: Info about sourced scripts is scattered.
Solution: Use scriptitem_T for info about a script, including s: variables.
Drop ga_scripts.
7ebcba61b2
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -1846,10 +1846,13 @@ scriptitem_T *new_script_item(char *const name, scid_T *const sid_out)
|
||||
while (script_items.ga_len < sid) {
|
||||
script_items.ga_len++;
|
||||
SCRIPT_ITEM(script_items.ga_len).sn_name = NULL;
|
||||
|
||||
// Allocate the local script variables to use for this script.
|
||||
new_script_vars(script_items.ga_len);
|
||||
|
||||
SCRIPT_ITEM(script_items.ga_len).sn_prof_on = false;
|
||||
}
|
||||
SCRIPT_ITEM(sid).sn_name = name;
|
||||
new_script_vars(sid); // Allocate the local script variables to use for this script.
|
||||
return &SCRIPT_ITEM(sid);
|
||||
}
|
||||
|
||||
@@ -2305,7 +2308,14 @@ void free_scriptnames(void)
|
||||
{
|
||||
profile_reset();
|
||||
|
||||
# define FREE_SCRIPTNAME(item) xfree((item)->sn_name)
|
||||
# define FREE_SCRIPTNAME(item) \
|
||||
do { \
|
||||
/* the variables themselves are cleared in evalvars_clear() */ \
|
||||
xfree((item)->sn_vars); \
|
||||
xfree((item)->sn_name); \
|
||||
ga_clear(&(item)->sn_prl_ga); \
|
||||
} while (0) \
|
||||
|
||||
GA_DEEP_CLEAR(&script_items, scriptitem_T, FREE_SCRIPTNAME);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user