vim-patch:9.1.0770: current command line completion is a bit limited (#30728)

Problem:  current command completion is a bit limited
Solution: Add the shellcmdline completion type and getmdcomplpat()
          function (Ruslan Russkikh).

closes: vim/vim#15823

0407d621bb

Co-authored-by: Ruslan Russkikh <dvrussk@yandex.ru>
This commit is contained in:
zeertzjq
2024-10-09 08:14:18 +08:00
committed by GitHub
parent e98b1b0235
commit f449a38f6a
11 changed files with 161 additions and 23 deletions

View File

@@ -3611,6 +3611,20 @@ M.funcs = {
returns = 'string',
signature = 'getcharstr([{expr}])',
},
getcmdcomplpat = {
desc = [=[
Return completion pattern of the current command-line.
Only works when the command line is being edited, thus
requires use of |c_CTRL-\_e| or |c_CTRL-R_=|.
Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()|,
|getcmdprompt()|, |getcmdcompltype()| and |setcmdline()|.
Returns an empty string when completion is not defined.
]=],
name = 'getcmdcomplpat',
params = {},
returns = 'string',
signature = 'getcmdcomplpat()',
},
getcmdcompltype = {
desc = [=[
Return the type of the current command-line completion.
@@ -3618,7 +3632,7 @@ M.funcs = {
requires use of |c_CTRL-\_e| or |c_CTRL-R_=|.
See |:command-completion| for the return string.
Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()|,
|getcmdprompt()| and |setcmdline()|.
|getcmdprompt()|, |getcmdcomplpat()| and |setcmdline()|.
Returns an empty string when completion is not defined.
]=],
name = 'getcmdcompltype',