summaryrefslogtreecommitdiff
path: root/src/structs.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-20 18:19:09 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-20 18:19:09 +0200
commit0cb5bcf5836de83f7d64fb01d3ce708caacaf66c (patch)
treee8cb22c78547909952536f9d024e95d8fdcc3369 /src/structs.h
parent845e0ee59430eac07e74b6cb92020e420d17953d (diff)
downloadvim-git-0cb5bcf5836de83f7d64fb01d3ce708caacaf66c.tar.gz
patch 8.2.1023: Vim9: redefining a function uses a new index every timev8.2.1023
Problem: Vim9: redefining a function uses a new index every time. Solution: When redefining a function clear the contents and re-use the index.
Diffstat (limited to 'src/structs.h')
-rw-r--r--src/structs.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/structs.h b/src/structs.h
index 700ac543c..9addf1ae1 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1531,8 +1531,11 @@ struct blobvar_S
typedef struct funccall_S funccall_T;
// values used for "uf_dfunc_idx"
-# define UF_NOT_COMPILED -2
-# define UF_TO_BE_COMPILED -1
+typedef enum {
+ UF_NOT_COMPILED,
+ UF_TO_BE_COMPILED,
+ UF_COMPILED
+} def_status_T;
/*
* Structure to hold info for a user function.
@@ -1543,7 +1546,8 @@ typedef struct
int uf_flags; // FC_ flags
int uf_calls; // nr of active calls
int uf_cleared; // func_clear() was already called
- int uf_dfunc_idx; // UF_NOT_COMPILED, UF_TO_BE_COMPILED or >= 0
+ def_status_T uf_def_status; // UF_NOT_COMPILED, UF_TO_BE_COMPILED, etc.
+ int uf_dfunc_idx; // only valid if uf_def_status is UF_COMPILED
garray_T uf_args; // arguments, including optional arguments
garray_T uf_def_args; // default argument expressions