api: Implement vim_report_error function

This function is used to report errors caused by remote functions called by
channel_send_call
This commit is contained in:
Thiago de Arruda
2014-09-11 10:35:52 -03:00
parent d29b62daab
commit 15ca58d79f
3 changed files with 20 additions and 12 deletions

View File

@@ -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