mirror of
https://github.com/neovim/neovim.git
synced 2026-05-30 00:35:42 +00:00
vim-patch:8.1.1940: script tests fail
Problem: Script tests fail.
Solution: Don't set vimvars type in set_vim_var_nr().
34ed68d40e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -5481,7 +5481,8 @@ static void filter_map_blob(blob_T *blob_arg, filtermap_T filtermap, typval_T *e
|
|||||||
b_ret = rettv->vval.v_blob;
|
b_ret = rettv->vval.v_blob;
|
||||||
}
|
}
|
||||||
|
|
||||||
vimvars[VV_KEY].vv_type = VAR_NUMBER;
|
// set_vim_var_nr() doesn't set the type
|
||||||
|
set_vim_var_type(VV_KEY, VAR_NUMBER);
|
||||||
|
|
||||||
const VarLockStatus prev_lock = b->bv_lock;
|
const VarLockStatus prev_lock = b->bv_lock;
|
||||||
if (b->bv_lock == 0) {
|
if (b->bv_lock == 0) {
|
||||||
@@ -5532,7 +5533,8 @@ static void filter_map_string(const char *str, filtermap_T filtermap, typval_T *
|
|||||||
rettv->v_type = VAR_STRING;
|
rettv->v_type = VAR_STRING;
|
||||||
rettv->vval.v_string = NULL;
|
rettv->vval.v_string = NULL;
|
||||||
|
|
||||||
vimvars[VV_KEY].vv_type = VAR_NUMBER;
|
// set_vim_var_nr() doesn't set the type
|
||||||
|
set_vim_var_type(VV_KEY, VAR_NUMBER);
|
||||||
|
|
||||||
garray_T ga;
|
garray_T ga;
|
||||||
ga_init(&ga, (int)sizeof(char), 80);
|
ga_init(&ga, (int)sizeof(char), 80);
|
||||||
@@ -5598,8 +5600,8 @@ static void filter_map_list(list_T *l, filtermap_T filtermap, const char *func_n
|
|||||||
tv_list_alloc_ret(rettv, kListLenUnknown);
|
tv_list_alloc_ret(rettv, kListLenUnknown);
|
||||||
l_ret = rettv->vval.v_list;
|
l_ret = rettv->vval.v_list;
|
||||||
}
|
}
|
||||||
|
// set_vim_var_nr() doesn't set the type
|
||||||
vimvars[VV_KEY].vv_type = VAR_NUMBER;
|
set_vim_var_type(VV_KEY, VAR_NUMBER);
|
||||||
|
|
||||||
const VarLockStatus prev_lock = tv_list_locked(l);
|
const VarLockStatus prev_lock = tv_list_locked(l);
|
||||||
if (tv_list_locked(l) == VAR_UNLOCKED) {
|
if (tv_list_locked(l) == VAR_UNLOCKED) {
|
||||||
@@ -6965,14 +6967,23 @@ void set_vcount(int64_t count, int64_t count1, bool set_prevcount)
|
|||||||
vimvars[VV_COUNT1].vv_nr = count1;
|
vimvars[VV_COUNT1].vv_nr = count1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set type of v: variable to the given type.
|
||||||
|
///
|
||||||
|
/// @param[in] idx Index of variable to set.
|
||||||
|
/// @param[in] type Type to set to.
|
||||||
|
void set_vim_var_type(const VimVarIndex idx, const VarType type)
|
||||||
|
{
|
||||||
|
vimvars[idx].vv_type = type;
|
||||||
|
}
|
||||||
|
|
||||||
/// Set number v: variable to the given value
|
/// Set number v: variable to the given value
|
||||||
|
/// Note that this does not set the type, use set_vim_var_type() for that.
|
||||||
///
|
///
|
||||||
/// @param[in] idx Index of variable to set.
|
/// @param[in] idx Index of variable to set.
|
||||||
/// @param[in] val Value to set to.
|
/// @param[in] val Value to set to.
|
||||||
void set_vim_var_nr(const VimVarIndex idx, const varnumber_T val)
|
void set_vim_var_nr(const VimVarIndex idx, const varnumber_T val)
|
||||||
{
|
{
|
||||||
tv_clear(&vimvars[idx].vv_tv);
|
tv_clear(&vimvars[idx].vv_tv);
|
||||||
vimvars[idx].vv_type = VAR_NUMBER;
|
|
||||||
vimvars[idx].vv_nr = val;
|
vimvars[idx].vv_nr = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3344,6 +3344,9 @@ static varnumber_T indexof_blob(blob_T *b, varnumber_T startidx, typval_T *expr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_vim_var_type(VV_KEY, VAR_NUMBER);
|
||||||
|
set_vim_var_type(VV_VAL, VAR_NUMBER);
|
||||||
|
|
||||||
const int called_emsg_start = called_emsg;
|
const int called_emsg_start = called_emsg;
|
||||||
for (varnumber_T idx = startidx; idx < tv_blob_len(b); idx++) {
|
for (varnumber_T idx = startidx; idx < tv_blob_len(b); idx++) {
|
||||||
set_vim_var_nr(VV_KEY, idx);
|
set_vim_var_nr(VV_KEY, idx);
|
||||||
@@ -3385,6 +3388,8 @@ static varnumber_T indexof_list(list_T *l, varnumber_T startidx, typval_T *expr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_vim_var_type(VV_KEY, VAR_NUMBER);
|
||||||
|
|
||||||
const int called_emsg_start = called_emsg;
|
const int called_emsg_start = called_emsg;
|
||||||
for (; item != NULL; item = TV_LIST_ITEM_NEXT(l, item), idx++) {
|
for (; item != NULL; item = TV_LIST_ITEM_NEXT(l, item), idx++) {
|
||||||
set_vim_var_nr(VV_KEY, idx);
|
set_vim_var_nr(VV_KEY, idx);
|
||||||
|
|||||||
@@ -709,6 +709,7 @@ void getout(int exitval)
|
|||||||
exitval += ex_exitval;
|
exitval += ex_exitval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_vim_var_type(VV_EXITING, VAR_NUMBER);
|
||||||
set_vim_var_nr(VV_EXITING, exitval);
|
set_vim_var_nr(VV_EXITING, exitval);
|
||||||
|
|
||||||
// Invoked all deferred functions in the function stack.
|
// Invoked all deferred functions in the function stack.
|
||||||
|
|||||||
Reference in New Issue
Block a user