diff options
-rw-r--r-- | src/nvim/eval.c | 6 | ||||
-rw-r--r-- | src/nvim/eval.h | 3 | ||||
-rw-r--r-- | src/nvim/eval/user_funcs.c | 4 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 7bdfde0dba..02ea0c88fc 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -81,8 +81,8 @@ static ScopeDictDictItem globvars_var; */ static hashtab_T compat_hashtab; -// Used for checking if local variables or arguments used in a lambda. -static int *eval_lavars_used = NULL; +/// Used for checking if local variables or arguments used in a lambda. +bool *eval_lavars_used = NULL; /* * Array to hold the hashtab with variables local to each sourced script. @@ -8232,7 +8232,7 @@ int get_var_tv( } /// Check if variable "name[len]" is a local variable or an argument. -/// If so, "*eval_lavars_used" is set to TRUE. +/// If so, "*eval_lavars_used" is set to true. static void check_vars(const char *name, size_t len) { if (eval_lavars_used == NULL) { diff --git a/src/nvim/eval.h b/src/nvim/eval.h index 6890d24252..ebc0eb0b1a 100644 --- a/src/nvim/eval.h +++ b/src/nvim/eval.h @@ -232,6 +232,9 @@ typedef enum { kDictListItems, ///< List dictionary contents: [keys, values]. } DictListType; +// Used for checking if local variables or arguments used in a lambda. +extern bool *eval_lavars_used; + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval.h.generated.h" #endif diff --git a/src/nvim/eval/user_funcs.c b/src/nvim/eval/user_funcs.c index 5ce7641a28..b3bd1e2860 100644 --- a/src/nvim/eval/user_funcs.c +++ b/src/nvim/eval/user_funcs.c @@ -159,8 +159,8 @@ int get_lambda_tv(char_u **arg, typval_T *rettv, bool evaluate) char_u *start = skipwhite(*arg + 1); char_u *s, *e; static int lambda_no = 0; - int *old_eval_lavars = eval_lavars_used; - int eval_lavars = false; + bool *old_eval_lavars = eval_lavars_used; + bool eval_lavars = false; // First, check if this is a lambda expression. "->" must exists. ret = get_function_args(&start, '-', NULL, NULL, true); |