diff src/evalfunc.c @ 10054:d4b7232fc63a v7.4.2298

commit https://github.com/vim/vim/commit/0874a83e9be1b39fdb217f02b427bf1d6133a4d8 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 1 15:11:51 2016 +0200 patch 7.4.2298 Problem: It is not possible to close the "in" part of a channel. Solution: Add ch_close_in().
author Christian Brabandt <cb@256bit.org>
date Thu, 01 Sep 2016 15:15:08 +0200
parents 4aead6a9b7a9
children a6068b90c873
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -77,6 +77,7 @@ static void f_ceil(typval_T *argvars, ty
 #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 *
 }
 
 /*
+ * "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