diff options
author | Evgeni Chasnovski <evgeni.chasnovski@gmail.com> | 2023-03-25 18:58:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-25 09:58:48 -0700 |
commit | fe9cbcb3a5c82932ecfb8f49d07e98a1fc2b31e5 (patch) | |
tree | b2828838c29b0a30befd703cf49a8d6cd16b89a0 /src/nvim/context.c | |
parent | 257d894d75bc583bb16f4dbe441907eb273d20ad (diff) | |
download | rneovim-fe9cbcb3a5c82932ecfb8f49d07e98a1fc2b31e5.tar.gz rneovim-fe9cbcb3a5c82932ecfb8f49d07e98a1fc2b31e5.tar.bz2 rneovim-fe9cbcb3a5c82932ecfb8f49d07e98a1fc2b31e5.zip |
feat(api): nvim_exec2(), deprecate nvim_exec() #19032
Problem:
The signature of nvim_exec() is not extensible per ":help api-contract".
Solution:
Introduce nvim_exec2() and deprecate nvim_exec().
Diffstat (limited to 'src/nvim/context.c')
-rw-r--r-- | src/nvim/context.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/context.c b/src/nvim/context.c index 9de6c16536..b13a331eff 100644 --- a/src/nvim/context.c +++ b/src/nvim/context.c @@ -10,6 +10,7 @@ #include <string.h> #include "nvim/api/private/converter.h" +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/api/vimscript.h" #include "nvim/context.h" @@ -271,8 +272,10 @@ static inline void ctx_save_funcs(Context *ctx, bool scriptonly) size_t cmd_len = sizeof("func! ") + strlen(name); char *cmd = xmalloc(cmd_len); snprintf(cmd, cmd_len, "func! %s", name); - String func_body = nvim_exec(VIML_INTERNAL_CALL, cstr_as_string(cmd), - true, &err); + Dict(exec_opts) opts = { 0 }; + opts.output = BOOLEAN_OBJ(true); + String func_body = exec_impl(VIML_INTERNAL_CALL, cstr_as_string(cmd), + &opts, &err); xfree(cmd); if (!ERROR_SET(&err)) { ADD(ctx->funcs, STRING_OBJ(func_body)); |