aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/msgpack_rpc/channel.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-12-09 08:55:31 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-12-09 08:55:31 -0300
commitc5b9e5d1d317b74d4adf7637cd9081be4ee52722 (patch)
tree46f2b1692851ae6afe3ffc5d9c2ebc700fe6b452 /src/nvim/msgpack_rpc/channel.c
parent8bb7aa329d20cb265d8952c96c84a0e54a5726ab (diff)
parent1192fbd08a054cece0b48dfb695e77e689997980 (diff)
downloadrneovim-c5b9e5d1d317b74d4adf7637cd9081be4ee52722.tar.gz
rneovim-c5b9e5d1d317b74d4adf7637cd9081be4ee52722.tar.bz2
rneovim-c5b9e5d1d317b74d4adf7637cd9081be4ee52722.zip
Merge PR #1605 'Abstract UI termcap'
Diffstat (limited to 'src/nvim/msgpack_rpc/channel.c')
-rw-r--r--src/nvim/msgpack_rpc/channel.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
index b6ac3fab82..4c35cce09a 100644
--- a/src/nvim/msgpack_rpc/channel.c
+++ b/src/nvim/msgpack_rpc/channel.c
@@ -10,6 +10,7 @@
#include "nvim/api/private/helpers.h"
#include "nvim/api/vim.h"
#include "nvim/msgpack_rpc/channel.h"
+#include "nvim/msgpack_rpc/remote_ui.h"
#include "nvim/os/event.h"
#include "nvim/os/rstream.h"
#include "nvim/os/rstream_defs.h"
@@ -100,6 +101,17 @@ void channel_init(void)
if (embedded_mode) {
channel_from_stdio();
}
+
+ if (abstract_ui) {
+ // Add handler for "attach_ui"
+ remote_ui_init();
+ String method = cstr_as_string("attach_ui");
+ MsgpackRpcRequestHandler handler = {.fn = remote_ui_attach, .defer = true};
+ msgpack_rpc_add_method_handler(method, handler);
+ method = cstr_as_string("detach_ui");
+ handler.fn = remote_ui_detach;
+ msgpack_rpc_add_method_handler(method, handler);
+ }
}
/// Teardown the module
@@ -645,6 +657,10 @@ static void on_stdio_close(Event e)
static void free_channel(Channel *channel)
{
+ if (abstract_ui) {
+ remote_ui_disconnect(channel->id);
+ }
+
pmap_del(uint64_t)(channels, channel->id);
msgpack_unpacker_free(channel->unpacker);