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

patch 8.0.0343: b:changedtick can be unlocked

Problem:    b:changedtick can be unlocked, even though it has no effect.
            (Nikolai Pavlov)
Solution:   Add a check and error E940. (closes #1496)
This commit is contained in:
Bram Moolenaar
2017-02-20 22:35:33 +01:00
parent 673911457d
commit e7877fe0de
4 changed files with 24 additions and 7 deletions

View File

@@ -2882,6 +2882,12 @@ do_lock_var(
di = find_var(lp->ll_name, NULL, TRUE);
if (di == NULL)
ret = FAIL;
else if ((di->di_flags & DI_FLAGS_FIX)
&& di->di_tv.v_type != VAR_DICT
&& di->di_tv.v_type != VAR_LIST)
/* For historic reasons this error is not given for a list or dict.
* E.g., the b: dict could be locked/unlocked. */
EMSG2(_("E940: Cannot lock or unlock variable %s"), lp->ll_name);
else
{
if (lock)