mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
API: nvim_source
This commit is contained in:

committed by
Justin M. Keyes

parent
70b6061666
commit
6aa03e86da
@@ -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.
|
||||
|
Reference in New Issue
Block a user