diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-09 10:53:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-09 10:53:47 +0800 |
commit | ecc40660d1577835245d99f95e14762a30d36054 (patch) | |
tree | 53cbb6ed1d26c80dcf0036603f9b17c9970d93cb /src | |
parent | ffd216e869fd7c18b9f608173c929500e26fe070 (diff) | |
download | rneovim-ecc40660d1577835245d99f95e14762a30d36054.tar.gz rneovim-ecc40660d1577835245d99f95e14762a30d36054.tar.bz2 rneovim-ecc40660d1577835245d99f95e14762a30d36054.zip |
fix(rpc): ignore redraw events when not in UI client (#21892)
Otherwise it will crash.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/msgpack_rpc/channel.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index d60e18590f..193c88646a 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -247,10 +247,12 @@ static void parse_msgpack(Channel *channel) Unpacker *p = channel->rpc.unpacker; while (unpacker_advance(p)) { if (p->type == kMessageTypeRedrawEvent) { - if (p->grid_line_event) { - ui_client_event_raw_line(p->grid_line_event); - } else if (p->ui_handler.fn != NULL && p->result.type == kObjectTypeArray) { - p->ui_handler.fn(p->result.data.array); + if (ui_client_channel_id) { + if (p->grid_line_event) { + ui_client_event_raw_line(p->grid_line_event); + } else if (p->ui_handler.fn != NULL && p->result.type == kObjectTypeArray) { + p->ui_handler.fn(p->result.data.array); + } } arena_mem_free(arena_finish(&p->arena)); } else if (p->type == kMessageTypeResponse) { |