Mercurial > vim
comparison src/eval.c @ 28313:b418e073b42f v8.2.4682
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Commit: https://github.com/vim/vim/commit/7a411a306f90339d8686e42ac16e1ae4fc7533c5
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Apr 4 14:58:06 2022 +0100
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Problem: Vim9: can use :unlockvar for const variable. (Ernie Rael)
Solution: Check whether the variable is a const.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 04 Apr 2022 16:00:03 +0200 |
parents | fff70771d4bb |
children | 6e501ecd1bb7 |
comparison
equal
deleted
inserted
replaced
28312:fb6d65010f23 | 28313:b418e073b42f |
---|---|
1063 if (vim9script && lp->ll_valtype == NULL | 1063 if (vim9script && lp->ll_valtype == NULL |
1064 && v != NULL | 1064 && v != NULL |
1065 && lp->ll_tv == &v->di_tv | 1065 && lp->ll_tv == &v->di_tv |
1066 && ht != NULL && ht == get_script_local_ht()) | 1066 && ht != NULL && ht == get_script_local_ht()) |
1067 { | 1067 { |
1068 svar_T *sv = find_typval_in_script(lp->ll_tv, 0); | 1068 svar_T *sv = find_typval_in_script(lp->ll_tv, 0, TRUE); |
1069 | 1069 |
1070 // Vim9 script local variable: get the type | 1070 // Vim9 script local variable: get the type |
1071 if (sv != NULL) | 1071 if (sv != NULL) |
1072 lp->ll_valtype = sv->sv_type; | 1072 lp->ll_valtype = sv->sv_type; |
1073 } | 1073 } |