From 68ca16c376bd8786ffc0c7ce7619b9a0ce5657e8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 16 Apr 2023 08:54:07 +0800 Subject: vim-patch:8.2.3783: confusing error for using a variable as a function Problem: Confusing error for using a variable as a function. Solution: If a function is not found but there is a variable, give a more useful error. (issue vim/vim#9310) https://github.com/vim/vim/commit/2ef9156b4284e4a52613c36e3d4667245273a28d Co-authored-by: Bram Moolenaar --- src/nvim/eval/userfunc.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim/eval/userfunc.h') diff --git a/src/nvim/eval/userfunc.h b/src/nvim/eval/userfunc.h index d0ad53c43d..4a98afb00e 100644 --- a/src/nvim/eval/userfunc.h +++ b/src/nvim/eval/userfunc.h @@ -75,6 +75,8 @@ typedef struct { partial_T *fe_partial; ///< for extra arguments dict_T *fe_selfdict; ///< Dictionary for "self" typval_T *fe_basetv; ///< base for base->method() + bool fe_found_var; ///< if the function is not found then give an + ///< error that a variable is not callable. } funcexe_T; #define FUNCEXE_INIT (funcexe_T) { \ @@ -86,6 +88,7 @@ typedef struct { .fe_partial = NULL, \ .fe_selfdict = NULL, \ .fe_basetv = NULL, \ + .fe_found_var = false, \ } #define FUNCARG(fp, j) ((char **)(fp->uf_args.ga_data))[j] -- cgit