aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Łuczyński <doubleloop@o2.pl>2020-02-10 11:23:58 +0100
committerJakub Łuczyński <doubleloop@o2.pl>2020-02-13 14:11:37 +0100
commit04f7e1f56d5f8c92fad49504e0f2215fdd72d326 (patch)
tree45d63a5f915df7f7e5e81b6ead98ccbb604253b4
parentbae1738bcec101984f8f54169191f5c0f17ab297 (diff)
downloadrneovim-04f7e1f56d5f8c92fad49504e0f2215fdd72d326.tar.gz
rneovim-04f7e1f56d5f8c92fad49504e0f2215fdd72d326.tar.bz2
rneovim-04f7e1f56d5f8c92fad49504e0f2215fdd72d326.zip
fix: var_set_global
-rw-r--r--src/nvim/eval.c5
-rw-r--r--src/nvim/eval/user_funcs.c4
2 files changed, 3 insertions, 6 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index bd223c7b78..f7e7c3a2d8 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -9770,10 +9770,9 @@ const void *var_shada_iter(const void *const iter, const char **const name,
void var_set_global(const char *const name, typval_T vartv)
{
- funccall_T *const saved_current_funccal = current_funccal;
- current_funccal = NULL;
+ funccall_T *const saved_funccal = (funccall_T *)save_funccal();
set_var(name, strlen(name), &vartv, false);
- current_funccal = saved_current_funccal;
+ restore_funccal(saved_funccal);
}
int store_session_globals(FILE *fd)
diff --git a/src/nvim/eval/user_funcs.c b/src/nvim/eval/user_funcs.c
index 487d290f6b..3c64e807ba 100644
--- a/src/nvim/eval/user_funcs.c
+++ b/src/nvim/eval/user_funcs.c
@@ -1117,9 +1117,7 @@ void *save_funccal(void)
void restore_funccal(void *vfc)
{
- funccall_T *fc = (funccall_T *)vfc;
-
- current_funccal = fc;
+ current_funccal = (funccall_T *)vfc;
}
#if defined(EXITFREE)