comparison src/evalfunc.c @ 13740:f309afff6f25 v8.0.1742

patch 8.0.1742: cannot get a list of all the jobs commit https://github.com/vim/vim/commit/e1fc51558dc14906a8d9f6a6e7bb1ac2a6ba8f3d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 21 19:49:08 2018 +0200 patch 8.0.1742: cannot get a list of all the jobs Problem: Cannot get a list of all the jobs. Cannot get the command of the job. Solution: When job_info() is called without an argument return a list of jobs. Otherwise, include the command that the job is running. (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Sat, 21 Apr 2018 20:00:07 +0200
parents 39fcaaa973db
children 9de2b25932eb
comparison
equal deleted inserted replaced
13739:0b766229da42 13740:f309afff6f25
680 {"isnan", 1, 1, f_isnan}, 680 {"isnan", 1, 1, f_isnan},
681 #endif 681 #endif
682 {"items", 1, 1, f_items}, 682 {"items", 1, 1, f_items},
683 #ifdef FEAT_JOB_CHANNEL 683 #ifdef FEAT_JOB_CHANNEL
684 {"job_getchannel", 1, 1, f_job_getchannel}, 684 {"job_getchannel", 1, 1, f_job_getchannel},
685 {"job_info", 1, 1, f_job_info}, 685 {"job_info", 0, 1, f_job_info},
686 {"job_setoptions", 2, 2, f_job_setoptions}, 686 {"job_setoptions", 2, 2, f_job_setoptions},
687 {"job_start", 1, 2, f_job_start}, 687 {"job_start", 1, 2, f_job_start},
688 {"job_status", 1, 1, f_job_status}, 688 {"job_status", 1, 1, f_job_status},
689 {"job_stop", 1, 2, f_job_stop}, 689 {"job_stop", 1, 2, f_job_stop},
690 #endif 690 #endif
7005 * "job_info()" function 7005 * "job_info()" function
7006 */ 7006 */
7007 static void 7007 static void
7008 f_job_info(typval_T *argvars, typval_T *rettv) 7008 f_job_info(typval_T *argvars, typval_T *rettv)
7009 { 7009 {
7010 job_T *job = get_job_arg(&argvars[0]); 7010 if (argvars[0].v_type != VAR_UNKNOWN)
7011 7011 {
7012 if (job != NULL && rettv_dict_alloc(rettv) != FAIL) 7012 job_T *job = get_job_arg(&argvars[0]);
7013 job_info(job, rettv->vval.v_dict); 7013
7014 if (job != NULL && rettv_dict_alloc(rettv) != FAIL)
7015 job_info(job, rettv->vval.v_dict);
7016 }
7017 else if (rettv_list_alloc(rettv) == OK)
7018 job_info_all(rettv->vval.v_list);
7014 } 7019 }
7015 7020
7016 /* 7021 /*
7017 * "job_setoptions()" function 7022 * "job_setoptions()" function
7018 */ 7023 */