@@ -927,7 +927,7 @@ channel_open_func(typval_T *argvars)
927927 opt .jo_mode = MODE_JSON ;
928928 opt .jo_timeout = 2000 ;
929929 if (get_job_options (& argvars [1 ], & opt ,
930- JO_MODE_ALL + JO_CB_ALL + JO_WAITTIME + JO_TIMEOUT_ALL ) == FAIL )
930+ JO_MODE_ALL + JO_CB_ALL + JO_WAITTIME + JO_TIMEOUT_ALL , 0 ) == FAIL )
931931 goto theend ;
932932 if (opt .jo_timeout < 0 )
933933 {
@@ -3429,7 +3429,7 @@ common_channel_read(typval_T *argvars, typval_T *rettv, int raw)
34293429 rettv -> vval .v_string = NULL ;
34303430
34313431 clear_job_options (& opt );
3432- if (get_job_options (& argvars [1 ], & opt , JO_TIMEOUT + JO_PART + JO_ID )
3432+ if (get_job_options (& argvars [1 ], & opt , JO_TIMEOUT + JO_PART + JO_ID , 0 )
34333433 == FAIL )
34343434 goto theend ;
34353435
@@ -3612,7 +3612,7 @@ send_common(
36123612 part_send = channel_part_send (channel );
36133613 * part_read = channel_part_read (channel );
36143614
3615- if (get_job_options (& argvars [2 ], opt , JO_CALLBACK + JO_TIMEOUT ) == FAIL )
3615+ if (get_job_options (& argvars [2 ], opt , JO_CALLBACK + JO_TIMEOUT , 0 ) == FAIL )
36163616 return NULL ;
36173617
36183618 /* Set the callback. An empty callback means no callback and not reading
@@ -4169,11 +4169,11 @@ part_from_char(int c)
41694169/*
41704170 * Get the option entries from the dict in "tv", parse them and put the result
41714171 * in "opt".
4172- * Only accept options in "supported".
4172+ * Only accept JO_ options in "supported" and JO2_ options in "supported2 ".
41734173 * If an option value is invalid return FAIL.
41744174 */
41754175 int
4176- get_job_options (typval_T * tv , jobopt_T * opt , int supported )
4176+ get_job_options (typval_T * tv , jobopt_T * opt , int supported , int supported2 )
41774177{
41784178 typval_T * item ;
41794179 char_u * val ;
@@ -4411,7 +4411,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported)
44114411#ifdef FEAT_TERMINAL
44124412 else if (STRCMP (hi -> hi_key , "term_name ") == 0 )
44134413 {
4414- if (!(supported & JO2_TERM_NAME ))
4414+ if (!(supported2 & JO2_TERM_NAME ))
44154415 break ;
44164416 opt -> jo_set2 |= JO2_TERM_NAME ;
44174417 opt -> jo_term_name = get_tv_string_chk (item );
@@ -4423,7 +4423,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported)
44234423 }
44244424 else if (STRCMP (hi -> hi_key , "term_finish ") == 0 )
44254425 {
4426- if (!(supported & JO2_TERM_FINISH ))
4426+ if (!(supported2 & JO2_TERM_FINISH ))
44274427 break ;
44284428 val = get_tv_string (item );
44294429 if (STRCMP (val , "open" ) != 0 && STRCMP (val , "close" ) != 0 )
@@ -4434,18 +4434,39 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported)
44344434 opt -> jo_set2 |= JO2_TERM_FINISH ;
44354435 opt -> jo_term_finish = * val ;
44364436 }
4437+ else if (STRCMP (hi -> hi_key , "term_rows ") == 0 )
4438+ {
4439+ if (!(supported2 & JO2_TERM_ROWS ))
4440+ break ;
4441+ opt -> jo_set |= JO2_TERM_ROWS ;
4442+ opt -> jo_term_rows = get_tv_number (item );
4443+ }
4444+ else if (STRCMP (hi -> hi_key , "term_cols ") == 0 )
4445+ {
4446+ if (!(supported2 & JO2_TERM_COLS ))
4447+ break ;
4448+ opt -> jo_set |= JO2_TERM_COLS ;
4449+ opt -> jo_term_cols = get_tv_number (item );
4450+ }
4451+ else if (STRCMP (hi -> hi_key , "vertical ") == 0 )
4452+ {
4453+ if (!(supported2 & JO2_VERTICAL ))
4454+ break ;
4455+ opt -> jo_set |= JO2_VERTICAL ;
4456+ opt -> jo_vertical = get_tv_number (item );
4457+ }
44374458#endif
44384459 else if (STRCMP (hi -> hi_key , "env ") == 0 )
44394460 {
4440- if (!(supported & JO2_ENV ))
4461+ if (!(supported2 & JO2_ENV ))
44414462 break ;
44424463 opt -> jo_set |= JO2_ENV ;
44434464 opt -> jo_env = item -> vval .v_dict ;
44444465 ++ item -> vval .v_dict -> dv_refcount ;
44454466 }
44464467 else if (STRCMP (hi -> hi_key , "cwd ") == 0 )
44474468 {
4448- if (!(supported & JO2_CWD ))
4469+ if (!(supported2 & JO2_CWD ))
44494470 break ;
44504471 opt -> jo_cwd = get_tv_string_buf_chk (item , opt -> jo_cwd_buf );
44514472 if (opt -> jo_cwd == NULL || !mch_isdir (opt -> jo_cwd ))
@@ -4956,7 +4977,7 @@ job_start(typval_T *argvars, jobopt_T *opt_arg)
49564977 opt .jo_mode = MODE_NL ;
49574978 if (get_job_options (& argvars [1 ], & opt ,
49584979 JO_MODE_ALL + JO_CB_ALL + JO_TIMEOUT_ALL + JO_STOPONEXIT
4959- + JO_EXIT_CB + JO_OUT_IO + JO_BLOCK_WRITE ) == FAIL )
4980+ + JO_EXIT_CB + JO_OUT_IO + JO_BLOCK_WRITE , 0 ) == FAIL )
49604981 goto theend ;
49614982 }
49624983
0 commit comments