eval: Forbid (un)locking b:changedtick

Port of vim-patch:8.0.0343
This commit is contained in:
ZyX
2017-02-23 00:59:11 +03:00
parent 9668d26a43
commit d8a7e5fdbb
3 changed files with 18 additions and 7 deletions

View File

@@ -3091,6 +3091,12 @@ static int do_lock_var(lval_T *lp, char_u *name_end, int deep, int lock)
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 historical reasons this error is not given for Lists and
// Dictionaries. E.g. b: dictionary may be locked/unlocked.
emsgf(_("E940: Cannot lock or unlock variable %s"), lp->ll_name);
} else {
if ((di->di_flags & (DI_FLAGS_LOCK|DI_FLAGS_FIX))
== (DI_FLAGS_LOCK|DI_FLAGS_FIX)) {