]> granicus.if.org Git - vim/commitdiff
patch 7.4.1687 v7.4.1687
authorBram Moolenaar <Bram@vim.org>
Wed, 30 Mar 2016 19:06:57 +0000 (21:06 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 30 Mar 2016 19:06:57 +0000 (21:06 +0200)
Problem:    The channel close_cb option does not work.
Solution:   Use jo_close_partial instead of jo_err_partial. (Damien)

src/channel.c
src/testdir/test_channel.vim
src/version.c

index 98bc6be63b0f653d78312ba17545f060f6e57e7a..b21c4432cc2ed14761d77e72c888f885ff6b582c 100644 (file)
@@ -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;
     }
index 5e34ad2ca1f186a85b3cc08c77fa17522fc5c9db..119f71a35521f40530b3d243c7dd631933c95218 100644 (file)
@@ -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:')
index f2976cb22f39218146bd467b6cae323f804266fa..6e599d813a4acda11aad8dff2a815f33f1dc4e2c 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1687,
 /**/
     1686,
 /**/