-*terminal.txt* For Vim version 9.1. Last change: 2024 Jun 08
+*terminal.txt* For Vim version 9.1. Last change: 2024 Jun 13
VIM REFERENCE MANUAL by Bram Moolenaar
term_getjob({buf}) *term_getjob()*
Get the Job associated with terminal window {buf}.
{buf} is used as with |term_getsize()|.
- Returns |v:null| when there is no job.
+ Returns |v:null| when there is no job. In Vim9 script, return
+ null_job when there is no job.
Can also be used as a |method|: >
GetBufnr()->term_getjob()
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;
}
def Test_term_getjob()
CheckRunVimInTerminal
v9.CheckSourceDefAndScriptFailure(['term_getjob(0z10)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1'])
+ v9.CheckSourceDefAndScriptSuccess(['assert_true(term_getjob(0) == null_job)'])
enddef
def Test_term_getline()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 481,
/**/
480,
/**/