summaryrefslogtreecommitdiff
path: root/src/evalfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-09-01 15:11:51 +0200
committerBram Moolenaar <Bram@vim.org>2016-09-01 15:11:51 +0200
commit0874a83e9be1b39fdb217f02b427bf1d6133a4d8 (patch)
tree7d949e2638d0fd36cf55cb2edfa70cba9638de3f /src/evalfunc.c
parentd8b554904d18fe19bd9fa79dbda880845cb017d2 (diff)
downloadvim-0874a83e9be1b39fdb217f02b427bf1d6133a4d8.zip
patch 7.4.2298
Problem: It is not possible to close the "in" part of a channel. Solution: Add ch_close_in().
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r--src/evalfunc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 578f0f582..9d94694d8 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -77,6 +77,7 @@ static void f_ceil(typval_T *argvars, typval_T *rettv);
#endif
#ifdef FEAT_JOB_CHANNEL
static void f_ch_close(typval_T *argvars, typval_T *rettv);
+static void f_ch_close_in(typval_T *argvars, typval_T *rettv);
static void f_ch_evalexpr(typval_T *argvars, typval_T *rettv);
static void f_ch_evalraw(typval_T *argvars, typval_T *rettv);
static void f_ch_getbufnr(typval_T *argvars, typval_T *rettv);
@@ -499,6 +500,7 @@ static struct fst
#endif
#ifdef FEAT_JOB_CHANNEL
{"ch_close", 1, 1, f_ch_close},
+ {"ch_close_in", 1, 1, f_ch_close_in},
{"ch_evalexpr", 2, 3, f_ch_evalexpr},
{"ch_evalraw", 2, 3, f_ch_evalraw},
{"ch_getbufnr", 2, 2, f_ch_getbufnr},
@@ -1792,6 +1794,18 @@ f_ch_close(typval_T *argvars, typval_T *rettv UNUSED)
}
/*
+ * "ch_close()" function
+ */
+ static void
+f_ch_close_in(typval_T *argvars, typval_T *rettv UNUSED)
+{
+ channel_T *channel = get_channel_arg(&argvars[0], TRUE, FALSE, 0);
+
+ if (channel != NULL)
+ channel_close_in(channel);
+}
+
+/*
* "ch_getbufnr()" function
*/
static void