0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 7.4.1624

Problem:    Can't get info about a channel.
Solution:   Add ch_info().
This commit is contained in:
Bram Moolenaar
2016-03-20 20:57:45 +01:00
parent e9d6a298df
commit 03602ec28e
6 changed files with 147 additions and 4 deletions

View File

@@ -501,6 +501,7 @@ static void f_ch_evalexpr(typval_T *argvars, typval_T *rettv);
static void f_ch_evalraw(typval_T *argvars, typval_T *rettv);
static void f_ch_getbufnr(typval_T *argvars, typval_T *rettv);
static void f_ch_getjob(typval_T *argvars, typval_T *rettv);
static void f_ch_info(typval_T *argvars, typval_T *rettv);
static void f_ch_log(typval_T *argvars, typval_T *rettv);
static void f_ch_logfile(typval_T *argvars, typval_T *rettv);
static void f_ch_open(typval_T *argvars, typval_T *rettv);
@@ -8141,6 +8142,7 @@ static struct fst
{"ch_evalraw", 2, 3, f_ch_evalraw},
{"ch_getbufnr", 2, 2, f_ch_getbufnr},
{"ch_getjob", 1, 1, f_ch_getjob},
{"ch_info", 1, 1, f_ch_info},
{"ch_log", 1, 2, f_ch_log},
{"ch_logfile", 1, 2, f_ch_logfile},
{"ch_open", 1, 2, f_ch_open},
@@ -10028,6 +10030,18 @@ f_ch_getjob(typval_T *argvars, typval_T *rettv)
}
}
/*
* "ch_info()" function
*/
static void
f_ch_info(typval_T *argvars, typval_T *rettv UNUSED)
{
channel_T *channel = get_channel_arg(&argvars[0], TRUE);
if (channel != NULL && rettv_dict_alloc(rettv) != FAIL)
channel_info(channel, rettv->vval.v_dict);
}
/*
* "ch_log()" function
*/