From 6e59b7b0e5cfe84db8629c728b942a5fea6bdda3 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Mon, 17 Aug 2015 13:19:53 -0300 Subject: tui/remote_ui: Fix some regressions - Explicitly set the SignalWatcher event queue. Without this, the watcher will publish events to the fast queue, resulting in resize bugs for certain terminals(#2322). - Set `async = false` to the `remote_ui_attach` handler(It was a deferred before, this is the new equivalent) --- src/nvim/msgpack_rpc/remote_ui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/msgpack_rpc') diff --git a/src/nvim/msgpack_rpc/remote_ui.c b/src/nvim/msgpack_rpc/remote_ui.c index 403ac13f2f..f0d92b52a0 100644 --- a/src/nvim/msgpack_rpc/remote_ui.c +++ b/src/nvim/msgpack_rpc/remote_ui.c @@ -28,7 +28,7 @@ void remote_ui_init(void) connected_uis = pmap_new(uint64_t)(); // Add handler for "attach_ui" String method = cstr_as_string("ui_attach"); - MsgpackRpcRequestHandler handler = {.fn = remote_ui_attach, .async = true}; + MsgpackRpcRequestHandler handler = {.fn = remote_ui_attach, .async = false}; msgpack_rpc_add_method_handler(method, handler); method = cstr_as_string("ui_detach"); handler.fn = remote_ui_detach; -- cgit From cb87670ff819161fb6ab70790d00ab87fc965aa7 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 21 Aug 2015 07:58:51 -0300 Subject: main: Initialize event loop before command_line_scan The call to `event_init()` was too late. `command_line_scan()` in `main()` could already need the loop initialized. Ref https://github.com/neovim/neovim/issues/3045#issuecomment-123405833. A consequence of this change is that it was necessary to move the `channel_from_stdio()` call to `command_line_scan()` when embedded_mode is set. --- src/nvim/msgpack_rpc/channel.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/nvim/msgpack_rpc') diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 0e3b8200c9..d8f86cefab 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -93,11 +93,6 @@ void channel_init(void) channels = pmap_new(uint64_t)(); event_strings = pmap_new(cstr_t)(); msgpack_sbuffer_init(&out_buffer); - - if (embedded_mode) { - channel_from_stdio(); - } - remote_ui_init(); } @@ -316,7 +311,7 @@ bool channel_close(uint64_t id) /// Creates an API channel from stdin/stdout. This is used when embedding /// Neovim -static void channel_from_stdio(void) +void channel_from_stdio(void) { Channel *channel = register_channel(kChannelTypeStdio); incref(channel); // stdio channels are only closed on exit -- cgit