mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
eval: Fix ex_delfunction
to use the uf_refcount
field properly
@4b98ea1e80bf changed how refcounts are handled internally to fit into job control semantics. Change the refcount check in `ex_delfunction` to consider this. Close #3000
This commit is contained in:
parent
0a116c828d
commit
b7dab423ef
@ -19832,7 +19832,9 @@ void ex_delfunction(exarg_T *eap)
|
||||
EMSG2(_("E131: Cannot delete function %s: It is in use"), eap->arg);
|
||||
return;
|
||||
}
|
||||
if (fp->uf_refcount > 1) {
|
||||
// check `uf_refcount > 2` because deleting a function should also reduce
|
||||
// the reference count, and 1 is the initial refcount.
|
||||
if (fp->uf_refcount > 2) {
|
||||
EMSG2(_("Cannot delete function %s: It is being used internally"),
|
||||
eap->arg);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user