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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user