0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.1698: cannot lock a variable in legacy Vim script like in Vim9

Problem:    Cannot lock a variable in legacy Vim script like in Vim9.
Solution:   Make ":lockvar 0" work.
This commit is contained in:
Bram Moolenaar
2020-09-16 21:08:28 +02:00
parent 7707228aac
commit a187c43cfe
11 changed files with 93 additions and 44 deletions

View File

@@ -3346,11 +3346,11 @@ def_function(exarg_T *eap, char_u *name_arg)
if (fudi.fd_di == NULL)
{
// Can't add a function to a locked dictionary
if (var_check_lock(fudi.fd_dict->dv_lock, eap->arg, FALSE))
if (value_check_lock(fudi.fd_dict->dv_lock, eap->arg, FALSE))
goto erret;
}
// Can't change an existing function if it is locked
else if (var_check_lock(fudi.fd_di->di_tv.v_lock, eap->arg, FALSE))
else if (value_check_lock(fudi.fd_di->di_tv.v_lock, eap->arg, FALSE))
goto erret;
// Give the function a sequential number. Can only be used with a