From f449a38f6a47bee30f0d4e291d8234d1ac8288a7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 9 Oct 2024 08:14:18 +0800 Subject: 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 https://github.com/vim/vim/commit/0407d621bbad020b840ffbbbd25ba023bbc05edd Co-authored-by: Ruslan Russkikh --- runtime/doc/builtin.txt | 13 ++++++++++++- runtime/doc/map.txt | 2 ++ runtime/doc/usr_41.txt | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 4c726f86d2..617fd87553 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -3224,13 +3224,24 @@ getcharstr([{expr}]) *getcharstr()* Return: ~ (`string`) +getcmdcomplpat() *getcmdcomplpat()* + 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. + + Return: ~ + (`string`) + getcmdcompltype() *getcmdcompltype()* Return the type of the current command-line completion. 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()|, - |getcmdprompt()| and |setcmdline()|. + |getcmdprompt()|, |getcmdcomplpat()| and |setcmdline()|. Returns an empty string when completion is not defined. Return: ~ diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 4a4e34661f..11048aee30 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1413,6 +1413,8 @@ completion can be enabled: -complete=runtime file and directory names in |'runtimepath'| -complete=scriptnames sourced script names -complete=shellcmd Shell command + -complete=shellcmdline First is a shell command and subsequent ones + are filenames. The same behavior as |:!cmd| -complete=sign |:sign| suboptions -complete=syntax syntax file names |'syntax'| -complete=syntime |:syntime| suboptions diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 8c7ed875cf..3202a70b76 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -906,6 +906,8 @@ Buffers, windows and the argument list: swapname() get the swap file path of a buffer Command line: *command-line-functions* + getcmdcomplpat() get completion pattern of the current command + line getcmdcompltype() get the type of the current command line completion getcmdline() get the current command line input -- cgit