diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-09-08 16:50:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-08 16:50:45 +0200 |
commit | 83632022f84e4addf9518bf9913cc58b2ae41820 (patch) | |
tree | d09e86ecd2f61d8e93175bceefa1468df0c586e3 /src/nvim/msgpack_rpc | |
parent | fa90f6cdaae800d9bfbc4f28ec04fb7456751dbe (diff) | |
parent | c705e3fb0b70887aaebe4973ce02acc6be45eb97 (diff) | |
download | rneovim-83632022f84e4addf9518bf9913cc58b2ae41820.tar.gz rneovim-83632022f84e4addf9518bf9913cc58b2ae41820.tar.bz2 rneovim-83632022f84e4addf9518bf9913cc58b2ae41820.zip |
Merge pull request #10959 from bfredl/resizequeue
fix crash on :!tmux split, redraw after resize in pager
Diffstat (limited to 'src/nvim/msgpack_rpc')
-rw-r--r-- | src/nvim/msgpack_rpc/channel.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 81c9f1e3f4..19f626c63b 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -31,6 +31,7 @@ #include "nvim/misc1.h" #include "nvim/lib/kvec.h" #include "nvim/os/input.h" +#include "nvim/ui.h" #if MIN_LOG_LEVEL > DEBUG_LOG_LEVEL #define log_client_msg(...) @@ -355,11 +356,19 @@ static void handle_request(Channel *channel, msgpack_object *request) request_event((void **)&evdata); } } else { - multiqueue_put(channel->events, request_event, 1, evdata); - DLOG("RPC: scheduled %.*s", method->via.bin.size, method->via.bin.ptr); + bool is_resize = handler.fn == handle_nvim_ui_try_resize; + if (is_resize) { + Event ev = event_split(event_create(request_event, 1, evdata), 2); + multiqueue_put_event(channel->events, ev); + multiqueue_put_event(resize_events, ev); + } else { + multiqueue_put(channel->events, request_event, 1, evdata); + DLOG("RPC: scheduled %.*s", method->via.bin.size, method->via.bin.ptr); + } } } + /// Handles a message, depending on the type: /// - Request: invokes method and writes the response (or error). /// - Notification: invokes method (emits `nvim_error_event` on error). |