summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-02-20 22:35:33 +0100
committerBram Moolenaar <Bram@vim.org>2017-02-20 22:35:33 +0100
commite7877fe0de1426f8de9ada825e4f7b64810c7dbc (patch)
tree435e94a70fad5f665ff87c5470f2f4611c0e46c2 /src/eval.c
parent673911457d6745b6b779eb769c2f41965592d12c (diff)
downloadvim-e7877fe0de1426f8de9ada825e4f7b64810c7dbc.zip
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)
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index 0bb188241..3cd73b6ea 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -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)