summaryrefslogtreecommitdiff
path: root/src/channel.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-02-16 21:03:07 +0100
committerBram Moolenaar <Bram@vim.org>2016-02-16 21:03:07 +0100
commit910b8aac5dc4693c4508b7acd2cef0bbfac04242 (patch)
treecb88e93372558043a8a0050d6ff5fa6704e74f02 /src/channel.c
parent7d63f624603ebeae336d4c504f82ab3da3481f46 (diff)
downloadvim-git-910b8aac5dc4693c4508b7acd2cef0bbfac04242.tar.gz
patch 7.4.1341v7.4.1341
Problem: It's difficult to add more arguments to ch_sendraw() and ch_sendexpr(). Solution: Make the third option a dictionary.
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/channel.c b/src/channel.c
index 3cfe1bea3..d4663d86e 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -697,6 +697,18 @@ channel_set_callback(channel_T *channel, char_u *callback)
}
/*
+ * Set various properties from an "options" argument.
+ */
+ void
+channel_set_options(channel_T *channel, jobopt_T *options)
+{
+ channel_set_mode(channel, options->jo_mode);
+
+ if (options->jo_callback != NULL && *options->jo_callback != NUL)
+ channel_set_callback(channel, options->jo_callback);
+}
+
+/*
* Set the callback for channel "channel" for the response with "id".
*/
void