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:
12
src/eval.c
12
src/eval.c
@@ -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)
|
||||
|
Reference in New Issue
Block a user