diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-05-26 18:11:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-26 18:11:49 +0200 |
commit | aabda31d5491398783ba70b2e24c58e68454db28 (patch) | |
tree | d7e098a649e5a13a2ff118d827a1a32078db60a1 /src/nvim/msgpack_rpc/channel.c | |
parent | 2b4c0181ba5a064b13f4e96e364124245e6f494c (diff) | |
parent | 8ed54bbec3b07d16658547d6bf38a1e804800341 (diff) | |
download | rneovim-aabda31d5491398783ba70b2e24c58e68454db28.tar.gz rneovim-aabda31d5491398783ba70b2e24c58e68454db28.tar.bz2 rneovim-aabda31d5491398783ba70b2e24c58e68454db28.zip |
Merge pull request #9547 from bfredl/rpc_multiline_err
messages: use proper multiline errors for rpcrequest and API wrappers
Diffstat (limited to 'src/nvim/msgpack_rpc/channel.c')
-rw-r--r-- | src/nvim/msgpack_rpc/channel.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 3438949e2d..2f3af22b65 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -687,6 +687,22 @@ Dictionary rpc_client_info(Channel *chan) return copy_dictionary(chan->rpc.info); } +const char *rpc_client_name(Channel *chan) +{ + if (!chan->is_rpc) { + return NULL; + } + Dictionary info = chan->rpc.info; + for (size_t i = 0; i < info.size; i++) { + if (strequal("name", info.items[i].key.data) + && info.items[i].value.type == kObjectTypeString) { + return info.items[i].value.data.string.data; + } + } + + return NULL; +} + #if MIN_LOG_LEVEL <= DEBUG_LOG_LEVEL #define REQ "[request] " #define RES "[response] " |