summaryrefslogtreecommitdiff
path: root/src/userfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-14 17:08:15 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-14 17:08:15 +0200
commitc4ce36d48698669f81ec90f7c9dc9ab8c362e538 (patch)
tree2aa5e74f7d240f306be115de7445db048ea2fb8b /src/userfunc.c
parentbc4c505166dc82911553206bb0c2133c6ac94aa1 (diff)
downloadvim-git-c4ce36d48698669f81ec90f7c9dc9ab8c362e538.tar.gz
patch 8.2.1445: Vim9: function expanded name is cleared when sourcing againv8.2.1445
Problem: Vim9: function expanded name is cleared when sourcing a script again. Solution: Only clear the expanded name when deleting the function. (closes #6707)
Diffstat (limited to 'src/userfunc.c')
-rw-r--r--src/userfunc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index 68287ec60..6c5776992 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -1090,7 +1090,6 @@ func_clear_items(ufunc_T *fp)
ga_clear_strings(&(fp->uf_args));
ga_clear_strings(&(fp->uf_def_args));
ga_clear_strings(&(fp->uf_lines));
- VIM_CLEAR(fp->uf_name_exp);
VIM_CLEAR(fp->uf_arg_types);
VIM_CLEAR(fp->uf_def_arg_idx);
VIM_CLEAR(fp->uf_va_name);
@@ -1146,7 +1145,10 @@ func_free(ufunc_T *fp, int force)
func_remove(fp);
if ((fp->uf_flags & FC_DEAD) == 0 || force)
+ {
+ VIM_CLEAR(fp->uf_name_exp);
vim_free(fp);
+ }
}
/*