From 887d32e54672cc3957bd2977df92fc3e9de10a52 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Thu, 26 Jun 2014 18:10:05 -0300 Subject: provider: New module used to expose extension points for core services Introducing the concept of providers: co-processes that talk with the editor through the remote API and provide implementation for one or more core services. The `provider_register` function and it's API wrapper can be used by channels that want to self-register as a service provider. Some old builtin vim features will be re-implemented as providers. The `provider_has_feature` function is used to check if a provider implementing a certain feature is available(It will be called by the `has` vimscript function to check for features in a vim-compatible way) This implements the provider module without exposing any extension points, which will be done in future commits. --- src/nvim/eval.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 428f1430b3..a3d07d8c4f 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -85,6 +85,7 @@ #include "nvim/api/private/helpers.h" #include "nvim/os/msgpack_rpc_helpers.h" #include "nvim/os/dl.h" +#include "nvim/os/provider.h" #define DICT_MAXNEST 100 /* maximum nesting of lists and dicts */ @@ -9807,6 +9808,10 @@ static void f_has(typval_T *argvars, typval_T *rettv) } } + if (n == FALSE && provider_has_feature((char *)name)) { + n = TRUE; + } + rettv->vval.v_number = n; } -- cgit