Patch 8.1.0618
Problem:    term_getjob() does not return v:null as documented.
Solution:   Do return v:null. (Damien)  Add a test.
Files:      src/terminal.c, src/testdir/test_terminal.vim


*** ../vim-8.1.0617/src/terminal.c      2018-12-21 16:04:16.316437487 +0100
--- src/terminal.c      2018-12-21 20:45:39.984928633 +0100
***************
*** 4794,4804 ****
  {
      buf_T     *buf = term_get_buf(argvars, "term_getjob()");
  
-     rettv->v_type = VAR_JOB;
-     rettv->vval.v_job = NULL;
      if (buf == NULL)
        return;
  
      rettv->vval.v_job = buf->b_term->tl_job;
      if (rettv->vval.v_job != NULL)
        ++rettv->vval.v_job->jv_refcount;
--- 4794,4807 ----
  {
      buf_T     *buf = term_get_buf(argvars, "term_getjob()");
  
      if (buf == NULL)
+     {
+       rettv->v_type = VAR_SPECIAL;
+       rettv->vval.v_number = VVAL_NULL;
        return;
+     }
  
+     rettv->v_type = VAR_JOB;
      rettv->vval.v_job = buf->b_term->tl_job;
      if (rettv->vval.v_job != NULL)
        ++rettv->vval.v_job->jv_refcount;
*** ../vim-8.1.0617/src/testdir/test_terminal.vim       2018-12-16 
16:16:05.384854629 +0100
--- src/testdir/test_terminal.vim       2018-12-21 20:44:48.205306549 +0100
***************
*** 1714,1716 ****
--- 1714,1721 ----
    call Stop_shell_in_terminal(bufnr)
    exe bufnr . 'bwipe'
  endfunc
+ 
+ func Test_terminal_no_job()
+   let term = term_start('false', {'term_finish': 'close'})
+   call WaitForAssert({-> assert_equal(v:null, term_getjob(term)) })
+ endfunc
*** ../vim-8.1.0617/src/version.c       2018-12-21 17:59:30.100109769 +0100
--- src/version.c       2018-12-21 20:55:03.092853384 +0100
***************
*** 801,802 ****
--- 801,804 ----
  {   /* Add new patch number below this line */
+ /**/
+     618,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
37. You start looking for hot HTML addresses in public restrooms.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui