mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.2.2687: Vim9: cannot use "const" for global variable in :def function
Problem: Vim9: cannot use "const" for global variable in :def function. Solution: Do allow using :const for a global variable. (closes #8030)
This commit is contained in:
@@ -963,9 +963,12 @@ check_for_number(typval_T *tv)
|
||||
store_var(char_u *name, typval_T *tv)
|
||||
{
|
||||
funccal_entry_T entry;
|
||||
int flags = ASSIGN_DECL;
|
||||
|
||||
if (tv->v_lock)
|
||||
flags |= ASSIGN_CONST;
|
||||
save_funccal(&entry);
|
||||
set_var_const(name, NULL, tv, FALSE, ASSIGN_DECL, 0);
|
||||
set_var_const(name, NULL, tv, FALSE, flags, 0);
|
||||
restore_funccal();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user