Mercurial > vim
diff src/eval.c @ 10908:6b6abffbdf59 v8.0.0343
patch 8.0.0343: b:changedtick can be unlocked
commit https://github.com/vim/vim/commit/e7877fe0de1426f8de9ada825e4f7b64810c7dbc
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Feb 20 22:35:33 2017 +0100
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 20 Feb 2017 22:45:05 +0100 |
parents | 5780bd3a5a7e |
children | 8bff367672a4 |
line wrap: on
line diff
--- 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)