1
0
forked from aniani/vim

patch 8.2.2223: Vim9: Reloading marks a :def function as deleted

Problem:    Vim9: Reloading marks a :def function as deleted.
Solution:   Clear the function contents but keep the index.
This commit is contained in:
Bram Moolenaar
2020-12-26 17:43:08 +01:00
parent 2b32700dab
commit cdc40c43f1
5 changed files with 18 additions and 38 deletions

View File

@@ -3628,7 +3628,7 @@ define_function(exarg_T *eap, char_u *name_arg)
fp->uf_profiling = FALSE;
fp->uf_prof_initialized = FALSE;
#endif
unlink_def_function(fp);
fp->uf_def_status = UF_NOT_COMPILED;
}
}
}
@@ -3694,8 +3694,6 @@ define_function(exarg_T *eap, char_u *name_arg)
fp = alloc_clear(offsetof(ufunc_T, uf_name) + STRLEN(name) + 1);
if (fp == NULL)
goto erret;
fp->uf_def_status = eap->cmdidx == CMD_def ? UF_TO_BE_COMPILED
: UF_NOT_COMPILED;
if (fudi.fd_dict != NULL)
{