forked from aniani/vim
patch 9.1.0481: Vim9: term_getjob() throws an exception on error
Problem: Vim9: term_getjob() throws an exception on error Solution: Return null_job instead, when there is no job (Ernie Rael) closes: #14984 Signed-off-by: Ernie Rael <errael@raelity.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
1c29602662
commit
a78eb25db3
@@ -6171,8 +6171,16 @@ f_term_getjob(typval_T *argvars, typval_T *rettv)
|
||||
buf = term_get_buf(argvars, "term_getjob()");
|
||||
if (buf == NULL)
|
||||
{
|
||||
rettv->v_type = VAR_SPECIAL;
|
||||
rettv->vval.v_number = VVAL_NULL;
|
||||
if (in_vim9script())
|
||||
{
|
||||
rettv->v_type = VAR_JOB;
|
||||
rettv->vval.v_job = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
rettv->v_type = VAR_SPECIAL;
|
||||
rettv->vval.v_number = VVAL_NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user