mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
Fix for review
This commit is contained in:
parent
bcaa4a840a
commit
b0fe068088
@ -4202,9 +4202,9 @@ getcmdcomplpat() *getcmdcomplpat()*
|
||||
|
||||
|
||||
getcmdcompltype([{pat}]) *getcmdcompltype()*
|
||||
Return the type of the {pat} command-line completion.
|
||||
If {pat} is ommited, return the type of the current
|
||||
command-line completion.
|
||||
Return the type of command-line completion using {pat}.
|
||||
If {pat} is omited, only works when the command line is being
|
||||
edited, thus requires use of |c_CTRL-\_e| or |c_CTRL-R_=|.
|
||||
|
||||
See |:command-completion| for the return string.
|
||||
Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()|,
|
||||
@ -4369,7 +4369,6 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
|
||||
<
|
||||
Return type: list<string>
|
||||
|
||||
|
||||
*getcurpos()*
|
||||
getcurpos([{winid}])
|
||||
Get the position of the cursor. This is like getpos('.'), but
|
||||
|
@ -4354,6 +4354,9 @@ f_getcmdcomplpat(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
void
|
||||
f_getcmdcompltype(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
if (check_for_opt_string_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
rettv->v_type = VAR_STRING;
|
||||
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
@ -4362,13 +4365,7 @@ f_getcmdcompltype(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
expand_T xpc;
|
||||
int cmdline_len;
|
||||
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
pat = tv_get_string(&argvars[0]);
|
||||
if (check_for_string_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
ExpandInit(&xpc);
|
||||
|
||||
cmdline_len = (int)STRLEN(pat);
|
||||
|
@ -4590,7 +4590,7 @@ func Test_range_complete()
|
||||
endfunc
|
||||
|
||||
func Test_getcmdcompltype_with_pat()
|
||||
call assert_fails('call getcmdcompltype({})', 'E731:')
|
||||
call assert_fails('call getcmdcompltype({})', 'E1174:')
|
||||
call assert_equal(getcmdcompltype(''), 'command')
|
||||
call assert_equal(getcmdcompltype('dummy '), '')
|
||||
call assert_equal(getcmdcompltype('cd '), 'dir_in_path')
|
||||
|
Loading…
x
Reference in New Issue
Block a user