|
31 | 31 | #include "nvim/misc1.h"
|
32 | 32 | #include "nvim/lib/kvec.h"
|
33 | 33 | #include "nvim/os/input.h"
|
| 34 | +#include "nvim/ui.h" |
34 | 35 |
|
35 | 36 | #if MIN_LOG_LEVEL > DEBUG_LOG_LEVEL
|
36 | 37 | #define log_client_msg(...)
|
@@ -289,6 +290,7 @@ static void parse_msgpack(Channel *channel)
|
289 | 290 | }
|
290 | 291 | }
|
291 | 292 |
|
| 293 | + |
292 | 294 | /// Handles requests and notifications received on the channel.
|
293 | 295 | static void handle_request(Channel *channel, msgpack_object *request)
|
294 | 296 | FUNC_ATTR_NONNULL_ALL
|
@@ -355,11 +357,19 @@ static void handle_request(Channel *channel, msgpack_object *request)
|
355 | 357 | request_event((void **)&evdata);
|
356 | 358 | }
|
357 | 359 | } else {
|
358 |
| - multiqueue_put(channel->events, request_event, 1, evdata); |
359 |
| - DLOG("RPC: scheduled %.*s", method->via.bin.size, method->via.bin.ptr); |
| 360 | + bool is_resize = handler.fn == handle_nvim_ui_try_resize; |
| 361 | + if (is_resize) { |
| 362 | + Event ev = event_split(event_create(request_event, 1, evdata), 2); |
| 363 | + multiqueue_put_event(channel->events, ev); |
| 364 | + multiqueue_put_event(resize_events, ev); |
| 365 | + } else { |
| 366 | + multiqueue_put(channel->events, request_event, 1, evdata); |
| 367 | + DLOG("RPC: scheduled %.*s", method->via.bin.size, method->via.bin.ptr); |
| 368 | + } |
360 | 369 | }
|
361 | 370 | }
|
362 | 371 |
|
| 372 | + |
363 | 373 | /// Handles a message, depending on the type:
|
364 | 374 | /// - Request: invokes method and writes the response (or error).
|
365 | 375 | /// - Notification: invokes method (emits `nvim_error_event` on error).
|
|
0 commit comments