diff options
author | Siddhant Gupta <dpsrkp.sid@gmail.com> | 2019-10-06 13:37:54 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-12-01 16:09:24 -0800 |
commit | 6aa03e86da041284b5f27a59f73cef0991fc577e (patch) | |
tree | 201627e8f546d1f7b4567e2794d514bfeaaed163 /src/nvim/api/vim.c | |
parent | 70b606166640d043fc7b78a52b89ff1bba798b6a (diff) | |
download | rneovim-6aa03e86da041284b5f27a59f73cef0991fc577e.tar.gz rneovim-6aa03e86da041284b5f27a59f73cef0991fc577e.tar.bz2 rneovim-6aa03e86da041284b5f27a59f73cef0991fc577e.zip |
API: nvim_source
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r-- | src/nvim/api/vim.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index e4a9bd64ff..ee36ae28e6 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -25,6 +25,7 @@ #include "nvim/highlight.h" #include "nvim/window.h" #include "nvim/types.h" +#include "nvim/ex_cmds2.h" #include "nvim/ex_docmd.h" #include "nvim/screen.h" #include "nvim/memline.h" @@ -72,6 +73,15 @@ void api_vim_free_all_mem(void) map_free(String, handle_T)(namespace_ids); } +void nvim_source(String command, Error *err) + FUNC_API_SINCE(5) +{ + try_start(); + do_source_str((char_u *)command.data); + update_screen(VALID); + try_end(err); +} + /// Executes an ex-command. /// /// On execution error: fails with VimL error, does not update v:errmsg. |