summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-30 21:06:57 +0200
committerBram Moolenaar <Bram@vim.org>2016-03-30 21:06:57 +0200
commitbdf0bda968a53a55149a4c83a10a60c28e431305 (patch)
tree8dd77e2ca5eb4bd62f8cf1fa3557ce8be961dd6c
parente9c07270031e312082604d3505650f185aa65948 (diff)
patch 7.4.1687v7.4.1687
Problem: The channel close_cb option does not work. Solution: Use jo_close_partial instead of jo_err_partial. (Damien)
-rw-r--r--src/channel.c2
-rw-r--r--src/testdir/test_channel.vim23
-rw-r--r--src/version.c2
3 files changed, 26 insertions, 1 deletions
diff --git a/src/channel.c b/src/channel.c
index 98bc6be63b..b21c4432cc 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -1103,7 +1103,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
*cbp = vim_strsave(opt->jo_close_cb);
else
*cbp = NULL;
- *pp = opt->jo_err_partial;
+ *pp = opt->jo_close_partial;
if (*pp != NULL)
++(*pp)->pt_refcount;
}
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index 5e34ad2ca1..119f71a355 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1203,6 +1203,29 @@ func Test_close_callback()
call s:run_server('s:test_close_callback')
endfunc
+function s:test_close_partial(port)
+ let handle = ch_open('localhost:' . a:port, s:chopt)
+ if ch_status(handle) == "fail"
+ call assert_false(1, "Can't open channel")
+ return
+ endif
+ let s:d = {}
+ func s:d.closeCb(ch) dict
+ let self.close_ret = 'closed'
+ endfunc
+ call ch_setoptions(handle, {'close_cb': s:d.closeCb})
+
+ call assert_equal('', ch_evalexpr(handle, 'close me'))
+ call s:waitFor('"closed" == s:d.close_ret')
+ call assert_equal('closed', s:d.close_ret)
+ unlet s:d
+endfunc
+
+func Test_close_partial()
+ call ch_log('Test_close_partial()')
+ call s:run_server('s:test_close_partial')
+endfunc
+
func Test_job_start_invalid()
call assert_fails('call job_start($x)', 'E474:')
call assert_fails('call job_start("")', 'E474:')
diff --git a/src/version.c b/src/version.c
index f2976cb22f..6e599d813a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -749,6 +749,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1687,
+/**/
1686,
/**/
1685,