diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-06-26 18:22:34 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-07-17 11:37:41 -0300 |
commit | 8a091e7f5c58a27fb3af1de76284430e812c95b5 (patch) | |
tree | 7816483f8655dff7628d115e0d97a3f3f688c8e3 /src/nvim/eval.c | |
parent | 887d32e54672cc3957bd2977df92fc3e9de10a52 (diff) | |
download | rneovim-8a091e7f5c58a27fb3af1de76284430e812c95b5.tar.gz rneovim-8a091e7f5c58a27fb3af1de76284430e812c95b5.tar.bz2 rneovim-8a091e7f5c58a27fb3af1de76284430e812c95b5.zip |
provider: Add support functions for calling external interpreters
This uses the provider module infrastructure to implement common code for
vimscript commands/functions that need to communicate with external
interpreters, eg: pydo, rubydo, pyfile, rubyfile, etc.
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index a3d07d8c4f..8eb4fa90d6 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -83,6 +83,7 @@ #include "nvim/os/time.h" #include "nvim/os/channel.h" #include "nvim/api/private/helpers.h" +#include "nvim/api/private/defs.h" #include "nvim/os/msgpack_rpc_helpers.h" #include "nvim/os/dl.h" #include "nvim/os/provider.h" @@ -19125,3 +19126,20 @@ static void apply_job_autocmds(Job *job, char *name, char *type, char *str) apply_autocmds(EVENT_JOBACTIVITY, (uint8_t *)name, NULL, TRUE, NULL); } +static void script_host_eval(char *method, typval_T *argvars, typval_T *rettv) +{ + Object result = provider_call(method, vim_to_object(argvars)); + + if (result.type == kObjectTypeNil) { + return; + } + + Error err = {.set = false}; + object_to_vim(result, rettv, &err); + msgpack_rpc_free_object(result); + + if (err.set) { + EMSG("Error converting value back to vim"); + } +} + |