diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-01-12 17:42:55 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-01-12 17:42:55 +0100 |
commit | 7ebcba61b20d25d23109fff73d0346ad44ba1b3b (patch) | |
tree | 4f600e5ca802400fa590f2222ebbab5b71445fa3 /src/structs.h | |
parent | 9b24dfcb9f676e7f7a09a9062f0d05b2104a87eb (diff) | |
download | vim-git-7ebcba61b20d25d23109fff73d0346ad44ba1b3b.tar.gz |
patch 8.2.0114: info about sourced scripts is scatteredv8.2.0114
Problem: Info about sourced scripts is scattered.
Solution: Use scriptitem_T for info about a script, including s: variables.
Drop ga_scripts.
Diffstat (limited to 'src/structs.h')
-rw-r--r-- | src/structs.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/structs.h b/src/structs.h index ffd6734e4..7e1508eb9 100644 --- a/src/structs.h +++ b/src/structs.h @@ -74,6 +74,8 @@ typedef struct VimMenu vimmenu_T; * function was defined, "sourcing_lnum" is the line number inside the * function. When stored with a function, mapping, option, etc. "sc_lnum" is * the line number in the script "sc_sid". + * + * sc_version is also here, for convenience. */ typedef struct { scid_T sc_sid; // script ID @@ -1566,13 +1568,28 @@ struct funccal_entry { #define HI2UF(hi) HIKEY2UF((hi)->hi_key) /* + * Holds the hashtab with variables local to each sourced script. + * Each item holds a variable (nameless) that points to the dict_T. + */ +typedef struct +{ + dictitem_T sv_var; + dict_T sv_dict; +} scriptvar_T; + +/* * Growarray to store info about already sourced scripts. * For Unix also store the dev/ino, so that we don't have to stat() each * script when going through the list. */ -typedef struct scriptitem_S +typedef struct { + scriptvar_T *sn_vars; // stores s: variables for this script + char_u *sn_name; + + int sn_version; // :scriptversion + # ifdef UNIX int sn_dev_valid; dev_t sn_dev; |