fix: func_init

This commit is contained in:
Jakub Łuczyński 2020-02-07 20:20:41 +01:00
parent 700d7a037c
commit c769b15fe4
3 changed files with 8 additions and 2 deletions

View File

@ -18,6 +18,7 @@
#include "nvim/charset.h" #include "nvim/charset.h"
#include "nvim/cursor.h" #include "nvim/cursor.h"
#include "nvim/edit.h" #include "nvim/edit.h"
#include "nvim/eval/user_funcs.h"
#include "nvim/eval.h" #include "nvim/eval.h"
#include "nvim/eval/encode.h" #include "nvim/eval/encode.h"
#include "nvim/eval/executor.h" #include "nvim/eval/executor.h"
@ -326,7 +327,7 @@ void eval_init(void)
init_var_dict(&vimvardict, &vimvars_var, VAR_SCOPE); init_var_dict(&vimvardict, &vimvars_var, VAR_SCOPE);
vimvardict.dv_lock = VAR_FIXED; vimvardict.dv_lock = VAR_FIXED;
hash_init(&compat_hashtab); hash_init(&compat_hashtab);
hash_init(&func_hashtab); func_init();
for (size_t i = 0; i < ARRAY_SIZE(vimvars); i++) { for (size_t i = 0; i < ARRAY_SIZE(vimvars); i++) {
p = &vimvars[i]; p = &vimvars[i];

View File

@ -63,6 +63,11 @@ static char *e_funcdict = N_("E717: Dictionary entry already exists");
static char *e_funcref = N_("E718: Funcref required"); static char *e_funcref = N_("E718: Funcref required");
static char *e_nofunc = N_("E130: Unknown function: %s"); static char *e_nofunc = N_("E130: Unknown function: %s");
void func_init(void)
{
hash_init(&func_hashtab);
}
/// Get function arguments. /// Get function arguments.
static int get_function_args(char_u **argp, char_u endchar, garray_T *newargs, static int get_function_args(char_u **argp, char_u endchar, garray_T *newargs,
int *varargs, bool skip) int *varargs, bool skip)

View File

@ -1,7 +1,7 @@
#ifndef NVIM_EVAL_USER_FUNCS_H #ifndef NVIM_EVAL_USER_FUNCS_H
#define NVIM_EVAL_USER_FUNCS_H #define NVIM_EVAL_USER_FUNCS_H
#include "nvim/eval/typeval.h" #include "nvim/eval/typval.h"
///< Structure used by trans_function_name() ///< Structure used by trans_function_name()
typedef struct { typedef struct {