summaryrefslogtreecommitdiffstats
path: root/src/evalvars.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/evalvars.c')
-rw-r--r--src/evalvars.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/evalvars.c b/src/evalvars.c
index a171c822f3..66018cff05 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -2564,9 +2564,9 @@ eval_variable(
int ret = OK;
typval_T *tv = NULL;
int found = FALSE;
- dictitem_T *v;
hashtab_T *ht = NULL;
int cc;
+ type_T *type = NULL;
// truncate the name, so that we can use strcmp()
cc = name[len];
@@ -2576,13 +2576,16 @@ eval_variable(
if ((tv = lookup_debug_var(name)) == NULL)
{
// Check for user-defined variables.
- v = find_var(name, &ht, flags & EVAL_VAR_NOAUTOLOAD);
+ dictitem_T *v = find_var(name, &ht, flags & EVAL_VAR_NOAUTOLOAD);
+
if (v != NULL)
{
tv = &v->di_tv;
if (dip != NULL)
*dip = v;
}
+ else
+ ht = NULL;
}
if (tv == NULL && (in_vim9script() || STRNCMP(name, "s:", 2) == 0))
@@ -2628,6 +2631,7 @@ eval_variable(
svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data)
+ import->imp_var_vals_idx;
tv = sv->sv_tv;
+ type = sv->sv_type;
}
}
else if (in_vim9script())
@@ -2656,13 +2660,10 @@ eval_variable(
}
else if (rettv != NULL)
{
- type_T *type = NULL;
-
if (ht != NULL && ht == get_script_local_ht())
{
- svar_T *sv = find_typval_in_script(tv, FALSE);
+ svar_T *sv = find_typval_in_script(tv);
- // TODO: check imported variable
if (sv != NULL)
type = sv->sv_type;
}