0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.1188: not all Vim variables require the v: prefix

Problem:    Not all Vim variables require the v: prefix.
Solution:   When scriptversion is 3 all Vim variables can only be used with
            the v: prefix.  (Ken Takata, closes #4274)
This commit is contained in:
Bram Moolenaar
2019-04-20 14:39:52 +02:00
parent 3a4c53ba51
commit d2e716e6df
5 changed files with 36 additions and 10 deletions

View File

@@ -7672,10 +7672,14 @@ find_var_ht(char_u *name, char_u **varname)
return NULL;
*varname = name;
/* "version" is "v:version" in all scopes */
hi = hash_find(&compat_hashtab, name);
if (!HASHITEM_EMPTY(hi))
return &compat_hashtab;
// "version" is "v:version" in all scopes if scriptversion < 3.
// Same for a few other variables marked with VV_COMPAT.
if (current_sctx.sc_version < 3)
{
hi = hash_find(&compat_hashtab, name);
if (!HASHITEM_EMPTY(hi))
return &compat_hashtab;
}
ht = get_funccal_local_ht();
if (ht == NULL)