diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-08-28 17:01:58 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-08-29 22:08:58 -0300 |
commit | a66d2d15382fb153bfa860c0b3ea7cb9630c8afa (patch) | |
tree | 6790fb6db9b1cccf006dacb4df175a28eb1dea6f /src/nvim/ops.c | |
parent | aa23d2f835e32c01b318712459ba7b9f55922469 (diff) | |
download | rneovim-a66d2d15382fb153bfa860c0b3ea7cb9630c8afa.tar.gz rneovim-a66d2d15382fb153bfa860c0b3ea7cb9630c8afa.tar.bz2 rneovim-a66d2d15382fb153bfa860c0b3ea7cb9630c8afa.zip |
msgpack-rpc: Always use arrays when sending events or calls
This is required by the msgpack-RPC specification. Also, the
send_call/send_event functions were refactored to accept a variable number of
arguments
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r-- | src/nvim/ops.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 0b0a913a95..f1cb34577b 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -5232,7 +5232,8 @@ static void get_clipboard(int name) struct yankreg *reg = &y_regs[CLIP_REGISTER]; free_register(reg); - Object result = provider_call("clipboard_get", NIL); + Array args = ARRAY_DICT_INIT; + Object result = provider_call("clipboard_get", args); if (result.type != kObjectTypeArray) { goto err; @@ -5278,12 +5279,15 @@ static void set_clipboard(int name) copy_register(reg, &y_regs[0]); } - Array lines = {0, 0, 0}; + Array lines = ARRAY_DICT_INIT; for (int i = 0; i < reg->y_size; i++) { ADD(lines, STRING_OBJ(cstr_to_string((char *)reg->y_array[i]))); } - Object result = provider_call("clipboard_set", ARRAY_OBJ(lines)); + Array args = ARRAY_DICT_INIT; + ADD(args, ARRAY_OBJ(lines)); + + Object result = provider_call("clipboard_set", args); msgpack_rpc_free_object(result); } |