Mercurial > vim
diff src/structs.h @ 19108:44c6498535c9 v8.2.0114
patch 8.2.0114: info about sourced scripts is scattered
Commit: https://github.com/vim/vim/commit/7ebcba61b20d25d23109fff73d0346ad44ba1b3b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 12 17:42:55 2020 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 12 Jan 2020 17:45:03 +0100 |
parents | ba9f50bfda83 |
children | 94eda51ba9ba |
line wrap: on
line diff
--- 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;