Mercurial > vim
diff src/userfunc.c @ 23360:eb7d8f39363c v8.2.2223
patch 8.2.2223: Vim9: Reloading marks a :def function as deleted
Commit: https://github.com/vim/vim/commit/cdc40c43f1008bda2f173d3a13606236679e8067
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 26 17:43:08 2020 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 26 Dec 2020 17:45:03 +0100 |
parents | 611e19cd237d |
children | a7cbdb9294c4 |
line wrap: on
line diff
--- a/src/userfunc.c +++ b/src/userfunc.c @@ -3628,7 +3628,7 @@ define_function(exarg_T *eap, char_u *na 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 *na 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) {