summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-12-21 20:55:22 +0100
committerBram Moolenaar <Bram@vim.org>2018-12-21 20:55:22 +0100
commit528ccfbaa1cc805f430a750c551e5a9fd7eb54fe (patch)
treead9ff072e6bca789211c011f18b8cf6bfd35ffad /src/terminal.c
parent1916673a1696eab66516c3f96bec1f2e4b92f761 (diff)
downloadvim-git-528ccfbaa1cc805f430a750c551e5a9fd7eb54fe.tar.gz
patch 8.1.0618: term_getjob() does not return v:null as documentedv8.1.0618
Problem: term_getjob() does not return v:null as documented. Solution: Do return v:null. (Damien) Add a test.
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/terminal.c b/src/terminal.c
index 20284af53..06d470c56 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -4794,11 +4794,14 @@ f_term_getjob(typval_T *argvars, typval_T *rettv)
{
buf_T *buf = term_get_buf(argvars, "term_getjob()");
- rettv->v_type = VAR_JOB;
- rettv->vval.v_job = NULL;
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;