feat(ui): connect to remote ui (only debug messages for now)

co-authored-by: hlpr98 <hlpr98@gmail.com>
This commit is contained in:
bfredl
2022-03-12 13:47:50 +01:00
parent 3a12737e6c
commit a4400bf8cd
6 changed files with 109 additions and 4 deletions

View File

@@ -30,6 +30,7 @@
#include "nvim/api/vimscript.h"
#include "nvim/api/win_config.h"
#include "nvim/api/window.h"
#include "nvim/ui_client.h"
static Map(String, MsgpackRpcRequestHandler) methods = MAP_INIT;
@@ -38,6 +39,13 @@ static void msgpack_rpc_add_method_handler(String method, MsgpackRpcRequestHandl
map_put(String, MsgpackRpcRequestHandler)(&methods, method, handler);
}
void msgpack_rpc_add_redraw(void)
{
msgpack_rpc_add_method_handler(STATIC_CSTR_AS_STRING("redraw"),
(MsgpackRpcRequestHandler) { .fn = ui_client_handle_redraw,
.fast = true });
}
/// @param name API method name
/// @param name_len name size (includes terminating NUL)
MsgpackRpcRequestHandler msgpack_rpc_get_handler_for(const char *name, size_t name_len,