aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/msgpack_rpc/channel.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-02-18 18:04:28 +0100
committerGitHub <noreply@github.com>2024-02-18 18:04:28 +0100
commit93c911e52feadff72003f7e78257c00c3bbf1570 (patch)
treeff0e65d868b9e30ec4759f13e3c3809f8fd41697 /src/nvim/msgpack_rpc/channel.c
parentd94adff48b1882f9078b0ae94b677be5d29e5fd2 (diff)
parent97531be1f766e6cad79e6360ae9cb827434cff3c (diff)
downloadrneovim-93c911e52feadff72003f7e78257c00c3bbf1570.tar.gz
rneovim-93c911e52feadff72003f7e78257c00c3bbf1570.tar.bz2
rneovim-93c911e52feadff72003f7e78257c00c3bbf1570.zip
Merge pull request #27511 from bfredl/maparena
refactor(api): use arena for mappings, autocmd, channel info
Diffstat (limited to 'src/nvim/msgpack_rpc/channel.c')
-rw-r--r--src/nvim/msgpack_rpc/channel.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
index b411854387..1208c91760 100644
--- a/src/nvim/msgpack_rpc/channel.c
+++ b/src/nvim/msgpack_rpc/channel.c
@@ -682,12 +682,11 @@ static WBuffer *serialize_response(uint64_t channel_id, MsgpackRpcRequestHandler
semsg("paste: %s", err->msg);
api_clear_error(err);
} else {
- Array args = ARRAY_DICT_INIT;
- ADD(args, INTEGER_OBJ(err->type));
- ADD(args, CSTR_TO_OBJ(err->msg));
+ MAXSIZE_TEMP_ARRAY(args, 2);
+ ADD_C(args, INTEGER_OBJ(err->type));
+ ADD_C(args, CSTR_AS_OBJ(err->msg));
msgpack_rpc_serialize_request(0, cstr_as_string("nvim_error_event"),
args, &pac);
- api_free_array(args);
}
} else {
msgpack_rpc_serialize_response(response_id, err, arg, &pac);