mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
feat: cmdline funcs (#18284)
vim-patch:8.2.4903: cannot get the current cmdline completion type and position Problem: Cannot get the current cmdline completion type and position. Solution: Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita, closes vim/vim#10344)79d599b877
vim-patch:8.2.4910: imperfect coding Problem: Imperfect coding. Solution: Make code nicer.9ff7d717aa
This commit is contained in:
@@ -3175,6 +3175,13 @@ static void f_getcharsearch(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
tv_dict_add_nr(dict, S_LEN("until"), last_csearch_until());
|
||||
}
|
||||
|
||||
/// "getcmdcompltype()" function
|
||||
static void f_getcmdcompltype(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
{
|
||||
rettv->v_type = VAR_STRING;
|
||||
rettv->vval.v_string = (char *)get_cmdline_completion();
|
||||
}
|
||||
|
||||
/// "getcmdline()" function
|
||||
static void f_getcmdline(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
{
|
||||
@@ -3188,6 +3195,12 @@ static void f_getcmdpos(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
rettv->vval.v_number = get_cmdline_pos() + 1;
|
||||
}
|
||||
|
||||
/// "getcmdscreenpos()" function
|
||||
static void f_getcmdscreenpos(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
{
|
||||
rettv->vval.v_number = get_cmdline_screen_pos() + 1;
|
||||
}
|
||||
|
||||
/// "getcmdtype()" function
|
||||
static void f_getcmdtype(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
{
|
||||
|
Reference in New Issue
Block a user