refactor(options)!: make OptionSet v: values use typval

BREAKING CHANGE: This breaks the OptionSet autocommand, as the `v:` values associated with it (`v:option_new`, `v:option_old`, `v:option_oldlocal` and `v:option_oldglobal`) are now the same type as the option, instead of all option values being converted to strings.
This commit is contained in:
Famiu Haque
2023-10-08 22:13:15 +06:00
parent 93b9c88946
commit 5df4fdf253
8 changed files with 151 additions and 90 deletions

View File

@@ -7226,6 +7226,17 @@ void set_vim_var_dict(const VimVarIndex idx, dict_T *const val)
tv_dict_set_keys_readonly(val);
}
/// Set v:variable to tv.
///
/// @param[in] idx Index of variable to set.
/// @param[in,out] val Value to set to. Reference count will be incremented.
/// Also keys of the dictionary will be made read-only.
void set_vim_var_tv(const VimVarIndex idx, typval_T *const tv)
{
tv_clear(&vimvars[idx].vv_di.di_tv);
vimvars[idx].vv_di.di_tv = *tv;
}
/// Set the v:argv list.
void set_argv_var(char **argv, int argc)
{