diff options
author | Jakub Łuczyński <doubleloop@o2.pl> | 2020-02-11 12:18:22 +0100 |
---|---|---|
committer | Jakub Łuczyński <doubleloop@o2.pl> | 2020-02-13 14:11:47 +0100 |
commit | 1e0a9b26908ab1f48e58435da9efca691179d63d (patch) | |
tree | bd32179d29cbb4b08d80a337049bf9c271fa4b5d | |
parent | 9d7ce03ef1f7332aee8ff2d752400ab0846d4191 (diff) | |
download | rneovim-1e0a9b26908ab1f48e58435da9efca691179d63d.tar.gz rneovim-1e0a9b26908ab1f48e58435da9efca691179d63d.tar.bz2 rneovim-1e0a9b26908ab1f48e58435da9efca691179d63d.zip |
fix: made eval_lavars_used global
-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); |