0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

patch 7.4.1356

Problem:    Job and channel options parsing is scattered.
Solution:   Move all option value parsing to get_job_options();
This commit is contained in:
Bram Moolenaar
2016-02-19 22:33:35 +01:00
parent ed5a78e11c
commit 40ea1da14b
6 changed files with 167 additions and 123 deletions

View File

@@ -748,24 +748,6 @@ channel_set_job(channel_T *channel, job_T *job)
channel->ch_job = job;
}
/*
* Set the mode of channel "channel" to "mode".
*/
void
channel_set_mode(channel_T *channel, ch_mode_T mode)
{
channel->ch_mode = mode;
}
/*
* Set the read timeout of channel "channel".
*/
void
channel_set_timeout(channel_T *channel, int timeout)
{
channel->ch_timeout = timeout;
}
/*
* Set the callback for channel "channel".
*/
@@ -782,9 +764,13 @@ channel_set_callback(channel_T *channel, char_u *callback)
void
channel_set_options(channel_T *channel, jobopt_T *options)
{
channel_set_mode(channel, options->jo_mode);
if (options->jo_set & JO_MODE)
channel->ch_mode = options->jo_mode;
if (options->jo_set & JO_TIMEOUT)
channel->ch_timeout = options->jo_timeout;
if (options->jo_callback != NULL && *options->jo_callback != NUL)
if ((options->jo_set & JO_CALLBACK)
&& options->jo_callback != NULL && *options->jo_callback != NUL)
channel_set_callback(channel, options->jo_callback);
}