From 15ca58d79f8cc8565c1a2b2581029cf7901b5fbd Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Thu, 11 Sep 2014 10:35:52 -0300 Subject: api: Implement `vim_report_error` function This function is used to report errors caused by remote functions called by channel_send_call --- src/nvim/api/vim.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nvim/api') diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index e14c427dc1..25454761ea 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -308,6 +308,16 @@ void vim_err_write(String str) write_msg(str, true); } +/// Higher level error reporting function that ensures all str contents +/// are written by sending a trailing linefeed to `vim_wrr_write` +/// +/// @param str The message +void vim_report_error(String str) +{ + vim_err_write(str); + vim_err_write((String) {.data = "\n", .size = 1}); +} + /// Gets the current list of buffer handles /// /// @return The number of buffers -- cgit