diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-03-12 15:22:55 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-03-12 15:22:55 +0100 |
commit | 8950a563b306ce76f259573d91c2ddccdf52e32e (patch) | |
tree | 0de3369989e3fe8b067541954cf02b2804097b58 /src/eval.c | |
parent | ac42afd10b96424b89762871905e3e785cdfba3d (diff) | |
download | vim-8950a563b306ce76f259573d91c2ddccdf52e32e.zip |
patch 7.4.1541
Problem: Missing job_info().
Solution: Implement it.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c index 5807707f1..f4843e2c0 100644 --- a/src/eval.c +++ b/src/eval.c @@ -632,6 +632,7 @@ static void f_isnan(typval_T *argvars, typval_T *rettv); static void f_items(typval_T *argvars, typval_T *rettv); #ifdef FEAT_JOB_CHANNEL static void f_job_getchannel(typval_T *argvars, typval_T *rettv); +static void f_job_info(typval_T *argvars, typval_T *rettv); static void f_job_setoptions(typval_T *argvars, typval_T *rettv); static void f_job_start(typval_T *argvars, typval_T *rettv); static void f_job_stop(typval_T *argvars, typval_T *rettv); @@ -8208,6 +8209,7 @@ static struct fst {"items", 1, 1, f_items}, #ifdef FEAT_JOB_CHANNEL {"job_getchannel", 1, 1, f_job_getchannel}, + {"job_info", 1, 1, f_job_info}, {"job_setoptions", 2, 2, f_job_setoptions}, {"job_start", 1, 2, f_job_start}, {"job_status", 1, 1, f_job_status}, @@ -14342,6 +14344,18 @@ f_job_getchannel(typval_T *argvars, typval_T *rettv) } /* + * "job_info()" function + */ + static void +f_job_info(typval_T *argvars, typval_T *rettv) +{ + job_T *job = get_job_arg(&argvars[0]); + + if (job != NULL && rettv_dict_alloc(rettv) != FAIL) + job_info(job, rettv->vval.v_dict); +} + +/* * "job_setoptions()" function */ static void @@ -14375,13 +14389,11 @@ f_job_start(typval_T *argvars, typval_T *rettv) f_job_status(typval_T *argvars, typval_T *rettv) { job_T *job = get_job_arg(&argvars[0]); - char *result; if (job != NULL) { - result = job_status(job); rettv->v_type = VAR_STRING; - rettv->vval.v_string = vim_strsave((char_u *)result); + rettv->vval.v_string = vim_strsave((char_u *)job_status(job)); } } |