mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.2.0078: expanding <sfile> works differently the second time
Problem: Expanding <sfile> works differently the second time. Solution: Keep the expanded name when redefining a function. (closes #5425)
This commit is contained in:
@@ -2572,9 +2572,13 @@ ex_function(exarg_T *eap)
|
||||
}
|
||||
else
|
||||
{
|
||||
// redefine existing function
|
||||
char_u *exp_name = fp->uf_name_exp;
|
||||
|
||||
// redefine existing function, keep the expanded name
|
||||
VIM_CLEAR(name);
|
||||
fp->uf_name_exp = NULL;
|
||||
func_clear_items(fp);
|
||||
fp->uf_name_exp = exp_name;
|
||||
#ifdef FEAT_PROFILE
|
||||
fp->uf_profiling = FALSE;
|
||||
fp->uf_prof_initialized = FALSE;
|
||||
|
Reference in New Issue
Block a user