diff options
| author | Bram Moolenaar <Bram@vim.org> | 2016-08-26 17:58:53 +0200 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2016-08-26 17:58:53 +0200 |
| commit | f1f0792e55e72cdc7c833b30f565a9b02f18bb1e (patch) | |
| tree | 0c63bd3971cde94874394587ca3bede776f87abf /src/channel.c | |
| parent | 9f28953f0c1e3d9fffd49af76503f54eaa279acb (diff) | |
| download | vim-git-f1f0792e55e72cdc7c833b30f565a9b02f18bb1e.tar.gz | |
patch 7.4.2258v7.4.2258
Problem: Two JSON messages are sent without a separator.
Solution: Separate messages with a NL. (closes #1001)
Diffstat (limited to 'src/channel.c')
| -rw-r--r-- | src/channel.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/channel.c b/src/channel.c index 443524885..748857423 100644 --- a/src/channel.c +++ b/src/channel.c @@ -2165,7 +2165,7 @@ channel_exe_cmd(channel_T *channel, int part, typval_T *argv) int id = argv[id_idx].vval.v_number; if (tv != NULL) - json = json_encode_nr_expr(id, tv, options); + json = json_encode_nr_expr(id, tv, options | JSON_NL); if (tv == NULL || (json != NULL && *json == NUL)) { /* If evaluation failed or the result can't be encoded @@ -2175,7 +2175,7 @@ channel_exe_cmd(channel_T *channel, int part, typval_T *argv) err_tv.v_type = VAR_STRING; err_tv.vval.v_string = (char_u *)"ERROR"; tv = &err_tv; - json = json_encode_nr_expr(id, tv, options); + json = json_encode_nr_expr(id, tv, options | JSON_NL); } if (json != NULL) { @@ -3500,7 +3500,7 @@ ch_expr_common(typval_T *argvars, typval_T *rettv, int eval) id = ++channel->ch_last_msg_id; text = json_encode_nr_expr(id, &argvars[1], - ch_mode == MODE_JS ? JSON_JS : 0); + (ch_mode == MODE_JS ? JSON_JS : 0) | JSON_NL); if (text == NULL) return; |
