vim-patch:8.2.0200: Vim9 script commands not sufficiently tested

Problem:    Vim9 script commands not sufficiently tested.
Solution:   Add more tests.  Fix storing global variable.  Make script
            variables work.

b283a8a680

Vim9 is N/A. Skip.

"set_vim_var_tv()" does not throw E1063 on type mismatch.
See https://github.com/neovim/neovim/pull/25394 .

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund Lazo
2025-10-05 12:55:48 -04:00
parent 4aac5908ed
commit 0c24ddb4d8
2 changed files with 11 additions and 10 deletions

View File

@@ -6597,16 +6597,6 @@ typval_T *get_vim_var_tv(const VimVarIndex idx)
return &vimvars[idx].vv_tv; return &vimvars[idx].vv_tv;
} }
/// Set v:variable to tv.
///
/// @param[in] idx Index of variable to set.
/// @param[in] val Value to set to. Will be copied.
void set_vim_var_tv(const VimVarIndex idx, typval_T *const tv)
{
tv_clear(&vimvars[idx].vv_di.di_tv);
tv_copy(tv, &vimvars[idx].vv_di.di_tv);
}
/// Set the v:argv list. /// Set the v:argv list.
void set_argv_var(char **argv, int argc) void set_argv_var(char **argv, int argc)
{ {

View File

@@ -1527,6 +1527,17 @@ dict_T *get_vimvar_dict(void)
return &vimvardict; return &vimvardict;
} }
/// Set v:variable to tv.
///
/// @param[in] idx Index of variable to set.
/// @param[in] val Value to set to. Will be copied.
void set_vim_var_tv(const VimVarIndex idx, typval_T *const tv)
{
typval_T *vv_tv = get_vim_var_tv(idx);
tv_clear(vv_tv);
tv_copy(tv, vv_tv);
}
/// Get number v: variable value. /// Get number v: variable value.
varnumber_T get_vim_var_nr(const VimVarIndex idx) FUNC_ATTR_PURE varnumber_T get_vim_var_nr(const VimVarIndex idx) FUNC_ATTR_PURE
{ {