summaryrefslogtreecommitdiffstats
path: root/src/structs.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-12 17:42:55 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-12 17:42:55 +0100
commit7ebcba61b20d25d23109fff73d0346ad44ba1b3b (patch)
tree4f600e5ca802400fa590f2222ebbab5b71445fa3 /src/structs.h
parent9b24dfcb9f676e7f7a09a9062f0d05b2104a87eb (diff)
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.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/structs.h b/src/structs.h
index ffd6734e42..7e1508eb9c 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;